From patchwork Mon Oct 14 08:27:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 20998 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f199.google.com (mail-qc0-f199.google.com [209.85.216.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6C51020D84 for ; Mon, 14 Oct 2013 08:27:12 +0000 (UTC) Received: by mail-qc0-f199.google.com with SMTP id n4sf13445802qcx.6 for ; Mon, 14 Oct 2013 01:27:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=ds882H+8ijjd6flioPuZ+hnwzKE6wbepN5oYiGZ++lE=; b=JVSN04nNx2XDM0o7mc+CM4yfhR5kOsQezIJ8q30U7lanokIK0JTegdBhOocca0ikEG Z2+CTkoGOJMNRtA3ljMbQqH08GL3US41p5woXChdexz2u7jtQAb2u54Ocvb+6nzGshQ3 CVsmWk+04tEfhpNh3xiEODYuAdWs8YOgTmgaKWkQKNH4OUa+OeeUlBx70ZZ6UbEfjCi7 e8OSlIjWYUDrPjoxPaGf+m+mOp47I4t4MfJZ7+iasDknU/gNWegxLpQVFI9EQBAehUhQ wCBOySGbKW5MufljdHT3VIt9taYKTVCWUxhFORI+ZLhUE21hp5Y/WXZFb65133z9lVK9 aMZQ== X-Received: by 10.236.101.103 with SMTP id a67mr28053783yhg.25.1381739231829; Mon, 14 Oct 2013 01:27:11 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.82.229 with SMTP id l5ls316746qey.11.gmail; Mon, 14 Oct 2013 01:27:11 -0700 (PDT) X-Received: by 10.58.168.205 with SMTP id zy13mr178343veb.19.1381739231736; Mon, 14 Oct 2013 01:27:11 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id st7si20800895vdc.94.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Oct 2013 01:27:11 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.177; Received: by mail-ve0-f177.google.com with SMTP id cz12so442850veb.8 for ; Mon, 14 Oct 2013 01:27:11 -0700 (PDT) X-Gm-Message-State: ALoCoQmlPPt2EhOh/ARoMQTdnKD2ANxmanN+nx/gKPBpzXrgFiwdQdCfMNLfhl8pElNoGxe4Po5i X-Received: by 10.52.36.239 with SMTP id t15mr28295362vdj.11.1381739231623; Mon, 14 Oct 2013 01:27:11 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp206449vcz; Mon, 14 Oct 2013 01:27:11 -0700 (PDT) X-Received: by 10.180.160.240 with SMTP id xn16mr13465386wib.62.1381739230715; Mon, 14 Oct 2013 01:27:10 -0700 (PDT) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx.google.com with ESMTPS id fz2si4982019wib.44.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Oct 2013 01:27:10 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=74.125.82.50; Received: by mail-wg0-f50.google.com with SMTP id n12so2000781wgh.5 for ; Mon, 14 Oct 2013 01:27:10 -0700 (PDT) X-Received: by 10.180.198.5 with SMTP id iy5mr3996285wic.45.1381739230177; Mon, 14 Oct 2013 01:27:10 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id s4sm31862426wiy.1.2013.10.14.01.27.08 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Mon, 14 Oct 2013 01:27:09 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Alexandre Courbot , Linus Walleij Subject: [PATCH] pinctrl: coh901: mark GPIO lines used for IRQ Date: Mon, 14 Oct 2013 10:27:04 +0200 Message-Id: <1381739224-5439-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.3.1 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , When an IRQ is started on a GPIO line, mark this GPIO as IRQ in the gpiolib so we can keep track of the usage centrally. Signed-off-by: Linus Walleij --- drivers/pinctrl/pinctrl-coh901.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/pinctrl/pinctrl-coh901.c b/drivers/pinctrl/pinctrl-coh901.c index f22a219..162ac0d 100644 --- a/drivers/pinctrl/pinctrl-coh901.c +++ b/drivers/pinctrl/pinctrl-coh901.c @@ -529,6 +529,10 @@ static void u300_gpio_irq_enable(struct irq_data *d) dev_dbg(gpio->dev, "enable IRQ for hwirq %lu on port %s, offset %d\n", d->hwirq, port->name, offset); + if (gpio_lock_as_irq(&gpio->chip, d->hwirq)) + dev_err(gpio->dev, + "unable to lock HW IRQ %lu for IRQ\n", + d->hwirq); local_irq_save(flags); val = readl(U300_PIN_REG(offset, ien)); writel(val | U300_PIN_BIT(offset), U300_PIN_REG(offset, ien)); @@ -547,6 +551,7 @@ static void u300_gpio_irq_disable(struct irq_data *d) val = readl(U300_PIN_REG(offset, ien)); writel(val & ~U300_PIN_BIT(offset), U300_PIN_REG(offset, ien)); local_irq_restore(flags); + gpio_unlock_as_irq(&gpio->chip, d->hwirq); } static struct irq_chip u300_gpio_irqchip = {