aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pinctrl/pinctrl-at91.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index 84a9594a0caa..421493cb490c 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -1453,6 +1453,7 @@ static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
1453 break; 1453 break;
1454 at91_gpio = at91_gpio->next; 1454 at91_gpio = at91_gpio->next;
1455 pio = at91_gpio->regbase; 1455 pio = at91_gpio->regbase;
1456 gpio_chip = &at91_gpio->chip;
1456 continue; 1457 continue;
1457 } 1458 }
1458 1459
@@ -1468,6 +1469,7 @@ static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
1468static int at91_gpio_of_irq_setup(struct device_node *node, 1469static int at91_gpio_of_irq_setup(struct device_node *node,
1469 struct at91_gpio_chip *at91_gpio) 1470 struct at91_gpio_chip *at91_gpio)
1470{ 1471{
1472 struct at91_gpio_chip *prev = NULL;
1471 struct irq_data *d = irq_get_irq_data(at91_gpio->pioc_virq); 1473 struct irq_data *d = irq_get_irq_data(at91_gpio->pioc_virq);
1472 int ret; 1474 int ret;
1473 1475
@@ -1493,6 +1495,17 @@ static int at91_gpio_of_irq_setup(struct device_node *node,
1493 panic("at91_gpio.%d: couldn't allocate irq domain (DT).\n", 1495 panic("at91_gpio.%d: couldn't allocate irq domain (DT).\n",
1494 at91_gpio->pioc_idx); 1496 at91_gpio->pioc_idx);
1495 1497
1498 /* Setup chained handler */
1499 if (at91_gpio->pioc_idx)
1500 prev = gpio_chips[at91_gpio->pioc_idx - 1];
1501
1502 /* The top level handler handles one bank of GPIOs, except
1503 * on some SoC it can handle up to three...
1504 * We only set up the handler for the first of the list.
1505 */
1506 if (prev && prev->next == at91_gpio)
1507 return 0;
1508
1496 /* Then register the chain on the parent IRQ */ 1509 /* Then register the chain on the parent IRQ */
1497 gpiochip_set_chained_irqchip(&at91_gpio->chip, 1510 gpiochip_set_chained_irqchip(&at91_gpio->chip,
1498 &gpio_irqchip, 1511 &gpio_irqchip,