diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2013-10-14 04:25:59 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-10-16 03:59:55 -0400 |
commit | 873ee9ed2c020b59e22a5082f73fc2960ec959bf (patch) | |
tree | 1553361b004e79db524f8f804a6f93a3d877e92e | |
parent | 494336f3a6eabeede8ce07b73f5023ff4f7c745d (diff) |
pinctrl: coh901: 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.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/pinctrl/pinctrl-coh901.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinctrl-coh901.c b/drivers/pinctrl/pinctrl-coh901.c index f22a2193d949..162ac0d73739 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) | |||
529 | 529 | ||
530 | dev_dbg(gpio->dev, "enable IRQ for hwirq %lu on port %s, offset %d\n", | 530 | dev_dbg(gpio->dev, "enable IRQ for hwirq %lu on port %s, offset %d\n", |
531 | d->hwirq, port->name, offset); | 531 | d->hwirq, port->name, offset); |
532 | if (gpio_lock_as_irq(&gpio->chip, d->hwirq)) | ||
533 | dev_err(gpio->dev, | ||
534 | "unable to lock HW IRQ %lu for IRQ\n", | ||
535 | d->hwirq); | ||
532 | local_irq_save(flags); | 536 | local_irq_save(flags); |
533 | val = readl(U300_PIN_REG(offset, ien)); | 537 | val = readl(U300_PIN_REG(offset, ien)); |
534 | writel(val | U300_PIN_BIT(offset), U300_PIN_REG(offset, ien)); | 538 | 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) | |||
547 | val = readl(U300_PIN_REG(offset, ien)); | 551 | val = readl(U300_PIN_REG(offset, ien)); |
548 | writel(val & ~U300_PIN_BIT(offset), U300_PIN_REG(offset, ien)); | 552 | writel(val & ~U300_PIN_BIT(offset), U300_PIN_REG(offset, ien)); |
549 | local_irq_restore(flags); | 553 | local_irq_restore(flags); |
554 | gpio_unlock_as_irq(&gpio->chip, d->hwirq); | ||
550 | } | 555 | } |
551 | 556 | ||
552 | static struct irq_chip u300_gpio_irqchip = { | 557 | static struct irq_chip u300_gpio_irqchip = { |