gpio irqs broken on imx27 with dt
Uwe Kleine-König
u.kleine-koenig at pengutronix.de
Sat Apr 28 06:31:38 EDT 2012
Hello,
On Fri, Apr 27, 2012 at 11:50:45PM +0200, Sascha Hauer wrote:
> On Fri, Apr 27, 2012 at 02:50:48PM +0200, Uwe Kleine-König wrote:
> > I experience problems on using gpio irqs on an imx27 based machine
> > booting with dt.
> >
> > I think one problem is:
> >
> > if (mxc_gpio_hwtype == IMX21_GPIO) {
> > /* setup one handler for all GPIO interrupts */
> > if (pdev->id == 0)
> > irq_set_chained_handler(port->irq,
> > mx2_gpio_irq_handler);
> > } ...
> >
> > because the inner if doesn't trigger as dt-created gpio devices have all
> > pdev->id == -1.
>
> How about
>
> static int once = 0;
>
> if (mxc_gpio_hwtype == IMX21_GPIO) {
> /* setup one handler for all GPIO interrupts */
> if (!once) {
> irq_set_chained_handler(port->irq,
> mx2_gpio_irq_handler);
> once = 1;
> }
I did exactly this, but it didn't cure all my problems. And it's ugly
(not much more than testing pdev->id == 0 though). I'm not sure it's
worth to clean that up. (e.g. use a single device for the imx21 type
handling all ports vs. one device per port for the latter types. This
way each device would handle one and only one irq.)
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
More information about the linux-arm-kernel
mailing list