From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: imx6 GPIO1 interrupts
Date: Thu, 25 Jun 2015 10:39:02 +0100 [thread overview]
Message-ID: <558BCC36.3070708@arm.com> (raw)
In-Reply-To: <CAMB+bfKULf-2wJbw8LH7r345_EvTOktS6zBJnNzAh69dZPtStw@mail.gmail.com>
[I only saw this thanks to Uwe who just replied...]
On 19/02/15 18:09, Joshua Clayton wrote:
> Freescale imx6 has gpios use shared irqs that trigger across 16 pins
> at a time. These are supported in the mainline kernel.
>
> The first 8 pins on GPIO1 also have their own interrupts on the GIC.
> I have a kluge sort of working, and am wondering what it would take
> for me to fully support these in a way that might be mainlined.
>
> What I am doing:
> (error checking removed for brevity)
>
> /* request the shared gpio irq to set the correct edge bits */
> gpiod = gpiod_get(my->dev, "diffirq");
> ret = gpiod_direction_input(gpiod);
> fake_irq = gpiod_to_irq(gpiod);
> ret = request_irq(fake_irq, no_action, 0, "gpio irq", mydev);
>
> /* Use the ARM GPIO4 irq */
> mydev->irq = irq_of_parse_and_map(mydev->dev->of_node, 0);
>
> ret = request_irq(mydev->irq, my_irq_handler, 0, "my fpga", mydev);
>
> disable_irq(mydev->irq);
> enable_irq(mydev->irq);
>
> This seems to work, but both irq appear in /proc/interrupts, and if I
> try to change the affinity of the hard irq the gpio irq gets all the
> traffic (or something)
>
> Looking at the code in drivers/gpio/gpio-mxc.c, it seems like almost
> all the code for full hardware irq support is already there, but just
> out of reach to my brain. I think I just need the hardware irq to call
> gpio_set_irq_type() for its set_type function.
>
> What is the proper way to do this? Do I need another virtual irq_chip
> for the 8 gpio1 irqs? Can something like that be set up in the gpio
> probe, or do I need to catch it earlier when the GIC is being
> probed/initialized?
>
> ...or am I way off base here?
This looks like something very similar to drivers/irqchip/irq-mtk-sysirq.c.
You may have to adapt your DT to make the devices point to the GPIO
block as an interrupt controller though.
Thanks,
M.
--
Jazz is not dead. It just smells funny...
prev parent reply other threads:[~2015-06-25 9:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-19 18:09 imx6 GPIO1 interrupts Joshua Clayton
2015-06-25 9:08 ` Uwe Kleine-König
2015-06-25 9:39 ` Marc Zyngier [this message]
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=558BCC36.3070708@arm.com \
--to=marc.zyngier@arm.com \
--cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.