[PATCH 1/8] pinctrl: sirf: convert to linear irq domain

Arnd Bergmann arnd at arndb.de
Mon Mar 25 05:33:16 EDT 2013


On Monday 25 March 2013, Barry Song wrote:
> > @@ -1770,9 +1767,8 @@ static int sirfsoc_gpio_probe(struct device_node *np)
> >                         goto out;
> >                 }
> >
> > -               bank->domain = irq_domain_add_legacy(np, SIRFSOC_GPIO_BANK_SIZE,
> > -                       SIRFSOC_GPIO_IRQ_START + i * SIRFSOC_GPIO_BANK_SIZE, 0,
> > -                       &sirfsoc_gpio_irq_simple_ops, bank);
> > +               bank->domain = irq_domain_add_linear(np, SIRFSOC_GPIO_BANK_SIZE,
> > +                                               &sirfsoc_gpio_irq_simple_ops, bank);
> 
> this line breaks the gpio/irq mapping and gpio irq_domain:
> 
>        printk("%s gpio_to_irq: %d %d %d\n", __func__,
>                gpio_to_irq(0), gpio_to_irq(32), gpio_to_irq(65));
> 
> result:
> sdhci_sirf_probe gpio_to_irq: 0 0 0
> 
> for the old codes, it works:
> sdhci_sirf_probe gpio_to_irq: 128 160 193

Does it work if you add the hunk below?

I think the problem is that with irq_domain_add_linear, we don't create
a mapping for all the interrupts right away.

	Arnd

diff --git a/drivers/pinctrl/pinctrl-sirf.c b/drivers/pinctrl/pinctrl-sirf.c
index d02498b..5f031ca 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)
 	struct sirfsoc_gpio_bank *bank = container_of(to_of_mm_gpio_chip(chip),
 		struct sirfsoc_gpio_bank, chip);
 
-	return irq_find_mapping(bank->domain, offset);
+	return irq_create_mapping(bank->domain, offset);
 }
 
 static inline int sirfsoc_gpio_to_offset(unsigned int gpio)



More information about the linux-arm-kernel mailing list