diff options
author | Rabin Vincent <rabin.vincent@stericsson.com> | 2010-03-18 08:05:22 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2011-03-14 14:05:14 +0100 |
commit | e493e06fedd86b484d172f961234f105f295d4d4 (patch) | |
tree | 563bfe6ed3cdba6c38408fdb97474305e8695aa1 /arch/arm/plat-nomadik/gpio.c | |
parent | mach-ux500: config Ux500 PL011 PL022 PL180 for DMA (diff) | |
download | linux-e493e06fedd86b484d172f961234f105f295d4d4.tar.xz linux-e493e06fedd86b484d172f961234f105f295d4d4.zip |
plat-nomadik: support varying number of GPIOs per block
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
[Added constant 32-pin assignment in platform data]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/plat-nomadik/gpio.c')
-rw-r--r-- | arch/arm/plat-nomadik/gpio.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/arm/plat-nomadik/gpio.c b/arch/arm/plat-nomadik/gpio.c index 1e88ecb846d1..30bb92a746e1 100644 --- a/arch/arm/plat-nomadik/gpio.c +++ b/arch/arm/plat-nomadik/gpio.c @@ -35,7 +35,6 @@ * Symbols in this file are called "nmk_gpio" for "nomadik gpio" */ -#define NMK_GPIO_PER_CHIP 32 struct nmk_gpio_chip { struct gpio_chip chip; void __iomem *addr; @@ -546,7 +545,7 @@ static int nmk_gpio_init_irq(struct nmk_gpio_chip *nmk_chip) int i; first_irq = NOMADIK_GPIO_TO_IRQ(nmk_chip->chip.base); - for (i = first_irq; i < first_irq + NMK_GPIO_PER_CHIP; i++) { + for (i = first_irq; i < first_irq + nmk_chip->chip.ngpio; i++) { set_irq_chip(i, &nmk_gpio_irq_chip); set_irq_handler(i, handle_edge_irq); set_irq_flags(i, IRQF_VALID); @@ -612,7 +611,6 @@ static struct gpio_chip nmk_gpio_template = { .direction_output = nmk_gpio_make_output, .set = nmk_gpio_set_output, .to_irq = nmk_gpio_to_irq, - .ngpio = NMK_GPIO_PER_CHIP, .can_sleep = 0, }; @@ -672,6 +670,7 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev) chip = &nmk_chip->chip; chip->base = pdata->first_gpio; + chip->ngpio = pdata->num_gpio; chip->label = pdata->name ?: dev_name(&dev->dev); chip->dev = &dev->dev; chip->owner = THIS_MODULE; |