Skip to content

Commit b426476

Browse files
committed
pinctrl: sirf: convert to linear irq domain
The sirf platforms use no hardcoded IRQ numbers, so there is no reason to use the legacy domain, and by converting to the linear domain, we get a more efficient representation of sparse IRQs and remove the dependency on the mach/irqs.h header file. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Linus Walleij <linus.walleij@linaro.org>
1 parent f8016f1 commit b426476

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

‎drivers/pinctrl/pinctrl-sirf.c‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,7 +1347,7 @@ static inline int sirfsoc_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
13471347
struct sirfsoc_gpio_bank *bank = container_of(to_of_mm_gpio_chip(chip),
13481348
struct sirfsoc_gpio_bank, chip);
13491349

1350-
return irq_find_mapping(bank->domain, offset);
1350+
return irq_create_mapping(bank->domain, offset);
13511351
}
13521352

13531353
static 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)
14851485
struct sirfsoc_gpio_bank *bank = irq_get_handler_data(irq);
14861486
u32 status, ctrl;
14871487
int idx = 0;
1488-
unsigned int first_irq;
14891488
struct irq_chip *chip = irq_get_chip(irq);
14901489

14911490
chained_irq_enter(chip, desc);
@@ -1499,8 +1498,6 @@ static void sirfsoc_gpio_handle_irq(unsigned int irq, struct irq_desc *desc)
14991498
return;
15001499
}
15011500

1502-
first_irq = bank->domain->revmap_data.legacy.first_irq;
1503-
15041501
while (status) {
15051502
ctrl = readl(bank->chip.regs + SIRFSOC_GPIO_CTRL(bank->id, idx));
15061503

@@ -1511,7 +1508,7 @@ static void sirfsoc_gpio_handle_irq(unsigned int irq, struct irq_desc *desc)
15111508
if ((status & 0x1) && (ctrl & SIRFSOC_GPIO_CTL_INTR_EN_MASK)) {
15121509
pr_debug("%s: gpio id %d idx %d happens\n",
15131510
__func__, bank->id, idx);
1514-
generic_handle_irq(first_irq + idx);
1511+
generic_handle_irq(irq_find_mapping(bank->domain, idx));
15151512
}
15161513

15171514
idx++;
@@ -1770,9 +1767,8 @@ static int sirfsoc_gpio_probe(struct device_node *np)
17701767
goto out;
17711768
}
17721769

1773-
bank->domain = irq_domain_add_legacy(np, SIRFSOC_GPIO_BANK_SIZE,
1774-
SIRFSOC_GPIO_IRQ_START + i * SIRFSOC_GPIO_BANK_SIZE, 0,
1775-
&sirfsoc_gpio_irq_simple_ops, bank);
1770+
bank->domain = irq_domain_add_linear(np, SIRFSOC_GPIO_BANK_SIZE,
1771+
&sirfsoc_gpio_irq_simple_ops, bank);
17761772

17771773
if (!bank->domain) {
17781774
pr_err("%s: Failed to create irqdomain\n", np->full_name);

0 commit comments

Comments
 (0)