diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2011-09-20 04:50:15 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2011-09-20 13:31:58 -0400 |
commit | 479a0c7eee68243ad9915a9ccc217a35c4e5e0e2 (patch) | |
tree | 66f244a55f27d51b0c5e89b29337ab9e97196869 /drivers/gpio | |
parent | 3c0227d262a5835849c68eb8328db016caad6085 (diff) |
gpio/nomadik: use genirq core to track enablement
Currently the Nomadik GPIO driver tracks enabled/disabled interrupt
status with a local variable, switch to using the interrupt core.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-nomadik.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/gpio/gpio-nomadik.c b/drivers/gpio/gpio-nomadik.c index 97e9be94141b..0b7ec1258c8e 100644 --- a/drivers/gpio/gpio-nomadik.c +++ b/drivers/gpio/gpio-nomadik.c | |||
@@ -58,7 +58,6 @@ struct nmk_gpio_chip { | |||
58 | u32 rwimsc; | 58 | u32 rwimsc; |
59 | u32 fwimsc; | 59 | u32 fwimsc; |
60 | u32 slpm; | 60 | u32 slpm; |
61 | u32 enabled; | ||
62 | u32 pull_up; | 61 | u32 pull_up; |
63 | }; | 62 | }; |
64 | 63 | ||
@@ -605,11 +604,6 @@ static int nmk_gpio_irq_maskunmask(struct irq_data *d, bool enable) | |||
605 | if (!nmk_chip) | 604 | if (!nmk_chip) |
606 | return -EINVAL; | 605 | return -EINVAL; |
607 | 606 | ||
608 | if (enable) | ||
609 | nmk_chip->enabled |= bitmask; | ||
610 | else | ||
611 | nmk_chip->enabled &= ~bitmask; | ||
612 | |||
613 | clk_enable(nmk_chip->clk); | 607 | clk_enable(nmk_chip->clk); |
614 | spin_lock_irqsave(&nmk_gpio_slpm_lock, flags); | 608 | spin_lock_irqsave(&nmk_gpio_slpm_lock, flags); |
615 | spin_lock(&nmk_chip->lock); | 609 | spin_lock(&nmk_chip->lock); |
@@ -653,7 +647,7 @@ static int nmk_gpio_irq_set_wake(struct irq_data *d, unsigned int on) | |||
653 | spin_lock_irqsave(&nmk_gpio_slpm_lock, flags); | 647 | spin_lock_irqsave(&nmk_gpio_slpm_lock, flags); |
654 | spin_lock(&nmk_chip->lock); | 648 | spin_lock(&nmk_chip->lock); |
655 | 649 | ||
656 | if (!(nmk_chip->enabled & bitmask)) | 650 | if (irqd_irq_disabled(d)) |
657 | __nmk_gpio_set_wake(nmk_chip, gpio, on); | 651 | __nmk_gpio_set_wake(nmk_chip, gpio, on); |
658 | 652 | ||
659 | if (on) | 653 | if (on) |
@@ -670,7 +664,7 @@ static int nmk_gpio_irq_set_wake(struct irq_data *d, unsigned int on) | |||
670 | 664 | ||
671 | static int nmk_gpio_irq_set_type(struct irq_data *d, unsigned int type) | 665 | static int nmk_gpio_irq_set_type(struct irq_data *d, unsigned int type) |
672 | { | 666 | { |
673 | bool enabled; | 667 | bool enabled = !irqd_irq_disabled(d); |
674 | bool wake = irqd_is_wakeup_set(d); | 668 | bool wake = irqd_is_wakeup_set(d); |
675 | int gpio; | 669 | int gpio; |
676 | struct nmk_gpio_chip *nmk_chip; | 670 | struct nmk_gpio_chip *nmk_chip; |
@@ -691,7 +685,6 @@ static int nmk_gpio_irq_set_type(struct irq_data *d, unsigned int type) | |||
691 | clk_enable(nmk_chip->clk); | 685 | clk_enable(nmk_chip->clk); |
692 | spin_lock_irqsave(&nmk_chip->lock, flags); | 686 | spin_lock_irqsave(&nmk_chip->lock, flags); |
693 | 687 | ||
694 | enabled = !!(nmk_chip->enabled & bitmask); | ||
695 | if (enabled) | 688 | if (enabled) |
696 | __nmk_gpio_irq_modify(nmk_chip, gpio, NORMAL, false); | 689 | __nmk_gpio_irq_modify(nmk_chip, gpio, NORMAL, false); |
697 | 690 | ||