From: Felix Radensky <felix@embedded-sol.com>
To: "linuxppc-dev@ozlabs.org" <linuxppc-dev@ozlabs.org>,
"jacmet@sunsite.dk" <jacmet@sunsite.dk>,
grant.likely@secretlab.ca
Subject: GPIO IRQ dts bindings for MPC85xx and QorIQ
Date: Tue, 09 Aug 2011 11:14:39 +0300 [thread overview]
Message-ID: <4E40EC6F.30601@embedded-sol.com> (raw)
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.
reply other threads:[~2011-08-09 8:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E40EC6F.30601@embedded-sol.com \
--to=felix@embedded-sol.com \
--cc=grant.likely@secretlab.ca \
--cc=jacmet@sunsite.dk \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).