diff options
Diffstat (limited to 'arch/arm/plat-nomadik')
-rw-r--r-- | arch/arm/plat-nomadik/gpio.c | 5 | ||||
-rw-r--r-- | arch/arm/plat-nomadik/include/plat/gpio.h | 1 |
2 files changed, 3 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 @@ | |||
35 | * Symbols in this file are called "nmk_gpio" for "nomadik gpio" | 35 | * Symbols in this file are called "nmk_gpio" for "nomadik gpio" |
36 | */ | 36 | */ |
37 | 37 | ||
38 | #define NMK_GPIO_PER_CHIP 32 | ||
39 | struct nmk_gpio_chip { | 38 | struct nmk_gpio_chip { |
40 | struct gpio_chip chip; | 39 | struct gpio_chip chip; |
41 | void __iomem *addr; | 40 | void __iomem *addr; |
@@ -546,7 +545,7 @@ static int nmk_gpio_init_irq(struct nmk_gpio_chip *nmk_chip) | |||
546 | int i; | 545 | int i; |
547 | 546 | ||
548 | first_irq = NOMADIK_GPIO_TO_IRQ(nmk_chip->chip.base); | 547 | first_irq = NOMADIK_GPIO_TO_IRQ(nmk_chip->chip.base); |
549 | for (i = first_irq; i < first_irq + NMK_GPIO_PER_CHIP; i++) { | 548 | for (i = first_irq; i < first_irq + nmk_chip->chip.ngpio; i++) { |
550 | set_irq_chip(i, &nmk_gpio_irq_chip); | 549 | set_irq_chip(i, &nmk_gpio_irq_chip); |
551 | set_irq_handler(i, handle_edge_irq); | 550 | set_irq_handler(i, handle_edge_irq); |
552 | set_irq_flags(i, IRQF_VALID); | 551 | set_irq_flags(i, IRQF_VALID); |
@@ -612,7 +611,6 @@ static struct gpio_chip nmk_gpio_template = { | |||
612 | .direction_output = nmk_gpio_make_output, | 611 | .direction_output = nmk_gpio_make_output, |
613 | .set = nmk_gpio_set_output, | 612 | .set = nmk_gpio_set_output, |
614 | .to_irq = nmk_gpio_to_irq, | 613 | .to_irq = nmk_gpio_to_irq, |
615 | .ngpio = NMK_GPIO_PER_CHIP, | ||
616 | .can_sleep = 0, | 614 | .can_sleep = 0, |
617 | }; | 615 | }; |
618 | 616 | ||
@@ -672,6 +670,7 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev) | |||
672 | 670 | ||
673 | chip = &nmk_chip->chip; | 671 | chip = &nmk_chip->chip; |
674 | chip->base = pdata->first_gpio; | 672 | chip->base = pdata->first_gpio; |
673 | chip->ngpio = pdata->num_gpio; | ||
675 | chip->label = pdata->name ?: dev_name(&dev->dev); | 674 | chip->label = pdata->name ?: dev_name(&dev->dev); |
676 | chip->dev = &dev->dev; | 675 | chip->dev = &dev->dev; |
677 | chip->owner = THIS_MODULE; | 676 | chip->owner = THIS_MODULE; |
diff --git a/arch/arm/plat-nomadik/include/plat/gpio.h b/arch/arm/plat-nomadik/include/plat/gpio.h index 67b113d639d8..d745f3ac0a61 100644 --- a/arch/arm/plat-nomadik/include/plat/gpio.h +++ b/arch/arm/plat-nomadik/include/plat/gpio.h | |||
@@ -82,6 +82,7 @@ struct nmk_gpio_platform_data { | |||
82 | char *name; | 82 | char *name; |
83 | int first_gpio; | 83 | int first_gpio; |
84 | int first_irq; | 84 | int first_irq; |
85 | int num_gpio; | ||
85 | }; | 86 | }; |
86 | 87 | ||
87 | #endif /* __ASM_PLAT_GPIO_H */ | 88 | #endif /* __ASM_PLAT_GPIO_H */ |