aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Walleij <[email protected]>2013-10-11 11:30:25 +0200
committerLinus Walleij <[email protected]>2013-10-16 09:59:55 +0200
commit494336f3a6eabeede8ce07b73f5023ff4f7c745d (patch)
tree190ee8d585e263ae7439634a612445faa9ef511a
parentd468bf9ecaabd3bf3a6134e5a369ced82b1d1ca1 (diff)
pinctrl: nomadik: mark GPIO lines used for IRQ
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. Cc: Enric Balletbo i Serra <[email protected]> Cc: Grant Likely <[email protected]> Cc: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> Cc: Santosh Shilimkar <[email protected]> Cc: Stephen Warren <[email protected]> Cc: Javier Martinez Canillas <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
-rw-r--r--drivers/pinctrl/pinctrl-nomadik.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c
index d7c3ae300fa7..7111c3b59130 100644
--- a/drivers/pinctrl/pinctrl-nomadik.c
+++ b/drivers/pinctrl/pinctrl-nomadik.c
@@ -634,6 +634,10 @@ static unsigned int nmk_gpio_irq_startup(struct irq_data *d)
{
struct nmk_gpio_chip *nmk_chip = irq_data_get_irq_chip_data(d);
+ if (gpio_lock_as_irq(&nmk_chip->chip, d->hwirq))
+ dev_err(nmk_chip->chip.dev,
+ "unable to lock HW IRQ %lu for IRQ\n",
+ d->hwirq);
clk_enable(nmk_chip->clk);
nmk_gpio_irq_unmask(d);
return 0;
@@ -645,6 +649,7 @@ static void nmk_gpio_irq_shutdown(struct irq_data *d)
nmk_gpio_irq_mask(d);
clk_disable(nmk_chip->clk);
+ gpio_unlock_as_irq(&nmk_chip->chip, d->hwirq);
}
static struct irq_chip nmk_gpio_irq_chip = {