From 1f2fc871a92d512db329872f60726f7eda70dc9e Mon Sep 17 00:00:00 2001 From: Nicolas Ferre Date: Sat, 11 Feb 2012 15:28:08 +0100 Subject: [PATCH] --- yaml --- r: 296191 b: refs/heads/master c: 4340cde57d54db2078d0f1ef070664e21d32711d h: refs/heads/master i: 296189: 62c6c039cbd2817f669e2c1a00b623156013a330 296187: 721cbbe3f60b7a065a605472a8e27a63b5d8bc84 296183: 2a5d51939fc3add63a9620400a6cac6888ca991c 296175: 8a7ed825355baba96608963849727bf1e46fa61d 296159: 1ad2c1b9b695718c66946dcd49dd999afac1c051 296127: 96e959d97286b35881d9e7c4cfe10b2050d3f36c 296063: 2d02ad0455504f98f4666673d53a4eabe79429be 295935: 4fc58dc31a5080c3898d5c1aa98da32ecc86ba57 v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-at91/gpio.c | 25 ++++++++++++++----------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/[refs] b/[refs] index edcbf94d6403..fbacfb07ef8c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e44990790a2528dc825a258bf931c745710f652e +refs/heads/master: 4340cde57d54db2078d0f1ef070664e21d32711d diff --git a/trunk/arch/arm/mach-at91/gpio.c b/trunk/arch/arm/mach-at91/gpio.c index 74d6783eeabb..b762afc4ec17 100644 --- a/trunk/arch/arm/mach-at91/gpio.c +++ b/trunk/arch/arm/mach-at91/gpio.c @@ -29,8 +29,8 @@ struct at91_gpio_chip { struct gpio_chip chip; struct at91_gpio_chip *next; /* Bank sharing same clock */ - int id; /* ID of register bank */ - void __iomem *regbase; /* Base of register bank */ + int pioc_hwirq; /* PIO bank interrupt identifier on AIC */ + void __iomem *regbase; /* PIO bank virtual address */ struct clk *clock; /* associated clock */ }; @@ -285,7 +285,7 @@ static int gpio_irq_set_wake(struct irq_data *d, unsigned state) else wakeups[bank] &= ~mask; - irq_set_irq_wake(gpio_chip[bank].id, state); + irq_set_irq_wake(gpio_chip[bank].pioc_hwirq, state); return 0; } @@ -499,7 +499,7 @@ void __init at91_gpio_irq_setup(void) for (pioc = 0, this = gpio_chip, prev = NULL; pioc++ < gpio_banks; prev = this, this++) { - unsigned id = this->id; + unsigned pioc_hwirq = this->pioc_hwirq; unsigned i; __raw_writel(~0, this->regbase + PIO_IDR); @@ -518,14 +518,14 @@ void __init at91_gpio_irq_setup(void) } /* The toplevel handler handles one bank of GPIOs, except - * AT91SAM9263_ID_PIOCDE handles three... PIOC is first in - * the list, so we only set up that handler. + * on some SoC it can handles up to three... + * We only set up the handler for the first of the list. */ if (prev && prev->next == this) continue; - irq_set_chip_data(id, this); - irq_set_chained_handler(id, gpio_irq_handler); + irq_set_chip_data(pioc_hwirq, this); + irq_set_chained_handler(pioc_hwirq, gpio_irq_handler); } pr_info("AT91: %d gpio irqs in %d banks\n", irq - gpio_to_irq(0), gpio_banks); } @@ -615,7 +615,7 @@ void __init at91_gpio_init(struct at91_gpio_bank *data, int nr_banks) for (i = 0; i < nr_banks; i++) { at91_gpio = &gpio_chip[i]; - at91_gpio->id = data[i].id; + at91_gpio->pioc_hwirq = data[i].pioc_hwirq; at91_gpio->chip.base = i * 32; at91_gpio->regbase = ioremap(data[i].regbase, 512); @@ -633,8 +633,11 @@ void __init at91_gpio_init(struct at91_gpio_bank *data, int nr_banks) /* enable PIO controller's clock */ clk_enable(at91_gpio->clock); - /* AT91SAM9263_ID_PIOCDE groups PIOC, PIOD, PIOE */ - if (last && last->id == at91_gpio->id) + /* + * GPIO controller are grouped on some SoC: + * PIOC, PIOD and PIOE can share the same IRQ line + */ + if (last && last->pioc_hwirq == at91_gpio->pioc_hwirq) last->next = at91_gpio; last = at91_gpio;