linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* device-tree: at91: irq and gpios: problem while requesting a gpio used as an interrupt source.
@ 2014-01-13 10:29 Jean-Jacques Hiblot
  2014-01-13 10:35 ` boris brezillon
  2014-01-15 12:02 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 2 replies; 24+ messages in thread
From: Jean-Jacques Hiblot @ 2014-01-13 10:29 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Nicolas, Jean-Christophe,

As I was trying to enable the touchscreen on the at91sam9261ek with
device-tree support, I ran into an issue. The touchscreen driver needs
to know the state of the pendown gpio and also needs it as an
interrupt source.

The problem is that when a gpio is used as an interrupt, it's
requested by the pinctrl driver during the xlate stage, marking it
unavaliable for the other driver.
It looks like the at91 pinctrl driver is the only one to use
gpio_request() in the xlate stage. Maybe we should remove this:

diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index a7549c4..cf91a35 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -1463,14 +1463,6 @@ static int at91_gpio_irq_domain_xlate(struct
irq_domain *d,
        *out_hwirq = intspec[0];
        *out_type = intspec[1] & IRQ_TYPE_SENSE_MASK;

-       ret = gpio_request(pin, ctrlr->full_name);
-       if (ret)
-               return ret;
-
-       ret = gpio_direction_input(pin);
-       if (ret)
-               return ret;
-
        return 0;
 }

Jean-Jacques

^ permalink raw reply related	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2014-01-31  8:03 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-13 10:29 device-tree: at91: irq and gpios: problem while requesting a gpio used as an interrupt source Jean-Jacques Hiblot
2014-01-13 10:35 ` boris brezillon
2014-01-13 11:05   ` Jean-Jacques Hiblot
2014-01-15 12:33     ` Jean-Christophe PLAGNIOL-VILLARD
2014-01-15 13:04       ` Jean-Jacques Hiblot
2014-01-15 13:20         ` Jean-Christophe PLAGNIOL-VILLARD
2014-01-15 13:44           ` Jean-Jacques Hiblot
2014-01-15 13:48             ` Arnd Bergmann
2014-01-15 13:56             ` Jean-Christophe PLAGNIOL-VILLARD
2014-01-15 14:41               ` Jean-Jacques Hiblot
2014-01-15 15:25                 ` Jean-Christophe PLAGNIOL-VILLARD
2014-01-15 15:30                   ` Jean-Jacques Hiblot
2014-01-15 18:00                     ` Jean-Christophe PLAGNIOL-VILLARD
2014-01-15 17:28   ` Nicolas Ferre
2014-01-22 10:11     ` Linus Walleij
2014-01-22 12:23       ` Jean-Jacques Hiblot
2014-01-15 18:06   ` Jean-Christophe PLAGNIOL-VILLARD
2014-01-16  8:54     ` boris brezillon
2014-01-16 11:04       ` Nicolas Ferre
2014-01-16 12:02         ` Jean-Jacques Hiblot
2014-01-22 10:15           ` Linus Walleij
2014-01-23 13:16             ` Jean-Jacques Hiblot
2014-01-31  8:03               ` Linus Walleij
2014-01-15 12:02 ` Jean-Christophe PLAGNIOL-VILLARD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).