* GPIO IRQ dts bindings for MPC85xx and QorIQ
@ 2011-08-09 8:14 Felix Radensky
0 siblings, 0 replies; only message in thread
From: Felix Radensky @ 2011-08-09 8:14 UTC (permalink / raw)
To: linuxppc-dev@ozlabs.org, jacmet@sunsite.dk, grant.likely
Hi,
DTS bindings document for mpc8xxx GPIOs implies that to use GPIO as IRQ
one should specify GPIO controller node and GPIO number in device tree
node,
like this:
funkyfpga@0 {
compatible = "funky-fpga";
...
interrupts = <9 2>;
interrupt-parent = <&gpio2>;
};
I suppose the intention here is to do the following in driver code:
int irq;
struct device node *np;
np = of_find_compatible_node((NULL, NULL, "funky-fpga");
irq = irq_of_parse_and_map(np, 0);
request_irq(irq, ...);
However this doesn't work as expected. The resulting virq
is connected to real interrupt controller, mpic, and not to
GPIO controller. As a result, interrupt handler is never invoked.
This is what /proc/interrupts shows:
20: 0 OpenPIC Edge funky-fpga
On the other hand, when using
#define FPGA_IRQ_GPIO 169
request_gpio(FPGA_IRQ_GPIO);
gpio_direction_input(FPGA_IRQ_GPIO);
irq = gpio_to_irq(FPGA_IRQ_GPIO);
request_irq(irq, ...);
the connection to GPIO controller is created properly,
/proc/interrupts shows
20: 0 mpc8xxx_gpio Edge funky-fpga
The drawback of this approach is that GPIO IRQ cannot
be naturally specified in device tree by GPIO controller number
and GPIO pin number.
So what is the correct way to refer to 85XX GPIO IRQs in driver
code ?
Thanks.
Felix.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-08-09 8:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-09 8:14 GPIO IRQ dts bindings for MPC85xx and QorIQ Felix Radensky
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).