diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2011-03-23 17:08:54 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2011-03-25 13:45:16 -0400 |
commit | cd11d14de91809ff3a150f823965a5b4209cad84 (patch) | |
tree | a356da8a0d39d508fd61a65da46179e5b2d1411a /arch/mips | |
parent | 42b64f388c171a7a1a8962d93d9bae2c04da7738 (diff) |
MIPS: JZ4740: GPIO: Use shared irq chip for all gpios
Currently there is one irq_chip per gpio_chip with the only difference
being the name. Since the information whether the irq belong to GPIO
bank A, B, C or D is not that important rewrite the code to simply use
a single irq_chip for all gpio_chips.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
To: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/2182/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/jz4740/gpio.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/arch/mips/jz4740/gpio.c b/arch/mips/jz4740/gpio.c index 1e28b758de1f..9bb0770fa76e 100644 --- a/arch/mips/jz4740/gpio.c +++ b/arch/mips/jz4740/gpio.c | |||
@@ -86,7 +86,6 @@ struct jz_gpio_chip { | |||
86 | spinlock_t lock; | 86 | spinlock_t lock; |
87 | 87 | ||
88 | struct gpio_chip gpio_chip; | 88 | struct gpio_chip gpio_chip; |
89 | struct irq_chip irq_chip; | ||
90 | struct sys_device sysdev; | 89 | struct sys_device sysdev; |
91 | }; | 90 | }; |
92 | 91 | ||
@@ -435,6 +434,17 @@ static int jz_gpio_irq_set_wake(struct irq_data *data, unsigned int on) | |||
435 | return 0; | 434 | return 0; |
436 | } | 435 | } |
437 | 436 | ||
437 | static struct irq_chip jz_gpio_irq_chip = { | ||
438 | .name = "GPIO", | ||
439 | .irq_mask = jz_gpio_irq_mask, | ||
440 | .irq_unmask = jz_gpio_irq_unmask, | ||
441 | .irq_ack = jz_gpio_irq_ack, | ||
442 | .irq_startup = jz_gpio_irq_startup, | ||
443 | .irq_shutdown = jz_gpio_irq_shutdown, | ||
444 | .irq_set_type = jz_gpio_irq_set_type, | ||
445 | .irq_set_wake = jz_gpio_irq_set_wake, | ||
446 | }; | ||
447 | |||
438 | /* | 448 | /* |
439 | * This lock class tells lockdep that GPIO irqs are in a different | 449 | * This lock class tells lockdep that GPIO irqs are in a different |
440 | * category than their parents, so it won't report false recursion. | 450 | * category than their parents, so it won't report false recursion. |
@@ -453,16 +463,6 @@ static struct lock_class_key gpio_lock_class; | |||
453 | .base = JZ4740_GPIO_BASE_ ## _bank, \ | 463 | .base = JZ4740_GPIO_BASE_ ## _bank, \ |
454 | .ngpio = JZ4740_GPIO_NUM_ ## _bank, \ | 464 | .ngpio = JZ4740_GPIO_NUM_ ## _bank, \ |
455 | }, \ | 465 | }, \ |
456 | .irq_chip = { \ | ||
457 | .name = "GPIO Bank " # _bank, \ | ||
458 | .irq_mask = jz_gpio_irq_mask, \ | ||
459 | .irq_unmask = jz_gpio_irq_unmask, \ | ||
460 | .irq_ack = jz_gpio_irq_ack, \ | ||
461 | .irq_startup = jz_gpio_irq_startup, \ | ||
462 | .irq_shutdown = jz_gpio_irq_shutdown, \ | ||
463 | .irq_set_type = jz_gpio_irq_set_type, \ | ||
464 | .irq_set_wake = jz_gpio_irq_set_wake, \ | ||
465 | }, \ | ||
466 | } | 466 | } |
467 | 467 | ||
468 | static struct jz_gpio_chip jz4740_gpio_chips[] = { | 468 | static struct jz_gpio_chip jz4740_gpio_chips[] = { |
@@ -529,7 +529,8 @@ static int jz4740_gpio_chip_init(struct jz_gpio_chip *chip, unsigned int id) | |||
529 | for (irq = chip->irq_base; irq < chip->irq_base + chip->gpio_chip.ngpio; ++irq) { | 529 | for (irq = chip->irq_base; irq < chip->irq_base + chip->gpio_chip.ngpio; ++irq) { |
530 | lockdep_set_class(&irq_desc[irq].lock, &gpio_lock_class); | 530 | lockdep_set_class(&irq_desc[irq].lock, &gpio_lock_class); |
531 | set_irq_chip_data(irq, chip); | 531 | set_irq_chip_data(irq, chip); |
532 | set_irq_chip_and_handler(irq, &chip->irq_chip, handle_level_irq); | 532 | set_irq_chip_and_handler(irq, &jz_gpio_irq_chip, |
533 | handle_level_irq); | ||
533 | } | 534 | } |
534 | 535 | ||
535 | return 0; | 536 | return 0; |