aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/pinctrl-sirf.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pinctrl/pinctrl-sirf.c')
-rw-r--r--drivers/pinctrl/pinctrl-sirf.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/pinctrl/pinctrl-sirf.c b/drivers/pinctrl/pinctrl-sirf.c
index 1ed23d02011e..bc9d1be27fb0 100644
--- a/drivers/pinctrl/pinctrl-sirf.c
+++ b/drivers/pinctrl/pinctrl-sirf.c
@@ -1347,7 +1347,7 @@ static inline int sirfsoc_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
1347 struct sirfsoc_gpio_bank *bank = container_of(to_of_mm_gpio_chip(chip), 1347 struct sirfsoc_gpio_bank *bank = container_of(to_of_mm_gpio_chip(chip),
1348 struct sirfsoc_gpio_bank, chip); 1348 struct sirfsoc_gpio_bank, chip);
1349 1349
1350 return irq_find_mapping(bank->domain, offset); 1350 return irq_create_mapping(bank->domain, offset);
1351} 1351}
1352 1352
1353static inline int sirfsoc_gpio_to_offset(unsigned int gpio) 1353static inline int sirfsoc_gpio_to_offset(unsigned int gpio)
@@ -1485,7 +1485,6 @@ static void sirfsoc_gpio_handle_irq(unsigned int irq, struct irq_desc *desc)
1485 struct sirfsoc_gpio_bank *bank = irq_get_handler_data(irq); 1485 struct sirfsoc_gpio_bank *bank = irq_get_handler_data(irq);
1486 u32 status, ctrl; 1486 u32 status, ctrl;
1487 int idx = 0; 1487 int idx = 0;
1488 unsigned int first_irq;
1489 struct irq_chip *chip = irq_get_chip(irq); 1488 struct irq_chip *chip = irq_get_chip(irq);
1490 1489
1491 chained_irq_enter(chip, desc); 1490 chained_irq_enter(chip, desc);
@@ -1499,8 +1498,6 @@ static void sirfsoc_gpio_handle_irq(unsigned int irq, struct irq_desc *desc)
1499 return; 1498 return;
1500 } 1499 }
1501 1500
1502 first_irq = bank->domain->revmap_data.legacy.first_irq;
1503
1504 while (status) { 1501 while (status) {
1505 ctrl = readl(bank->chip.regs + SIRFSOC_GPIO_CTRL(bank->id, idx)); 1502 ctrl = readl(bank->chip.regs + SIRFSOC_GPIO_CTRL(bank->id, idx));
1506 1503
@@ -1511,7 +1508,7 @@ static void sirfsoc_gpio_handle_irq(unsigned int irq, struct irq_desc *desc)
1511 if ((status & 0x1) && (ctrl & SIRFSOC_GPIO_CTL_INTR_EN_MASK)) { 1508 if ((status & 0x1) && (ctrl & SIRFSOC_GPIO_CTL_INTR_EN_MASK)) {
1512 pr_debug("%s: gpio id %d idx %d happens\n", 1509 pr_debug("%s: gpio id %d idx %d happens\n",
1513 __func__, bank->id, idx); 1510 __func__, bank->id, idx);
1514 generic_handle_irq(first_irq + idx); 1511 generic_handle_irq(irq_find_mapping(bank->domain, idx));
1515 } 1512 }
1516 1513
1517 idx++; 1514 idx++;
@@ -1764,9 +1761,8 @@ static int sirfsoc_gpio_probe(struct device_node *np)
1764 goto out; 1761 goto out;
1765 } 1762 }
1766 1763
1767 bank->domain = irq_domain_add_legacy(np, SIRFSOC_GPIO_BANK_SIZE, 1764 bank->domain = irq_domain_add_linear(np, SIRFSOC_GPIO_BANK_SIZE,
1768 SIRFSOC_GPIO_IRQ_START + i * SIRFSOC_GPIO_BANK_SIZE, 0, 1765 &sirfsoc_gpio_irq_simple_ops, bank);
1769 &sirfsoc_gpio_irq_simple_ops, bank);
1770 1766
1771 if (!bank->domain) { 1767 if (!bank->domain) {
1772 pr_err("%s: Failed to create irqdomain\n", np->full_name); 1768 pr_err("%s: Failed to create irqdomain\n", np->full_name);