Skip to content

Commit 33a4e98

Browse files
Uwe Kleine-Königlinusw
authored andcommitted
gpio/mxc: make irqs work for fsl,imx21-gpio devices
The chained handler was set for the platform device with id == 0. When the gpio devices are instantiated by a device tree, all have id == -1 and so the handler was unset resulting in unusable gpio irqs on i.MX21 and i.MX27 (when using oftree). Acked-by: Shawn Guo <[email protected]> Cc: Grant Likely <[email protected]> Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent f567fde commit 33a4e98

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/gpio/gpio-mxc.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,10 +398,12 @@ static int __devinit mxc_gpio_probe(struct platform_device *pdev)
398398
writel(~0, port->base + GPIO_ISR);
399399

400400
if (mxc_gpio_hwtype == IMX21_GPIO) {
401-
/* setup one handler for all GPIO interrupts */
402-
if (pdev->id == 0)
403-
irq_set_chained_handler(port->irq,
404-
mx2_gpio_irq_handler);
401+
/*
402+
* Setup one handler for all GPIO interrupts. Actually setting
403+
* the handler is needed only once, but doing it for every port
404+
* is more robust and easier.
405+
*/
406+
irq_set_chained_handler(port->irq, mx2_gpio_irq_handler);
405407
} else {
406408
/* setup one handler for each entry */
407409
irq_set_chained_handler(port->irq, mx3_gpio_irq_handler);

0 commit comments

Comments
 (0)