Commit 494336f3a6eabeede8ce07b73f5023ff4f7c745d

Authored by Linus Walleij
1 parent d468bf9eca

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 <eballetbo@gmail.com>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff

drivers/pinctrl/pinctrl-nomadik.c
... ... @@ -634,6 +634,10 @@
634 634 {
635 635 struct nmk_gpio_chip *nmk_chip = irq_data_get_irq_chip_data(d);
636 636  
  637 + if (gpio_lock_as_irq(&nmk_chip->chip, d->hwirq))
  638 + dev_err(nmk_chip->chip.dev,
  639 + "unable to lock HW IRQ %lu for IRQ\n",
  640 + d->hwirq);
637 641 clk_enable(nmk_chip->clk);
638 642 nmk_gpio_irq_unmask(d);
639 643 return 0;
... ... @@ -645,6 +649,7 @@
645 649  
646 650 nmk_gpio_irq_mask(d);
647 651 clk_disable(nmk_chip->clk);
  652 + gpio_unlock_as_irq(&nmk_chip->chip, d->hwirq);
648 653 }
649 654  
650 655 static struct irq_chip nmk_gpio_irq_chip = {