diff options
-rw-r--r-- | arch/arm/plat-omap/gpio.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c index 6216f4f09e82..2f185ffaca4a 100644 --- a/arch/arm/plat-omap/gpio.c +++ b/arch/arm/plat-omap/gpio.c | |||
@@ -724,7 +724,11 @@ static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio, | |||
724 | OMAP4_GPIO_IRQWAKEN0); | 724 | OMAP4_GPIO_IRQWAKEN0); |
725 | } | 725 | } |
726 | } else { | 726 | } else { |
727 | if (trigger != 0) | 727 | /* |
728 | * GPIO wakeup request can only be generated on edge | ||
729 | * transitions | ||
730 | */ | ||
731 | if (trigger & IRQ_TYPE_EDGE_BOTH) | ||
728 | __raw_writel(1 << gpio, bank->base | 732 | __raw_writel(1 << gpio, bank->base |
729 | + OMAP24XX_GPIO_SETWKUENA); | 733 | + OMAP24XX_GPIO_SETWKUENA); |
730 | else | 734 | else |
@@ -734,7 +738,13 @@ static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio, | |||
734 | } | 738 | } |
735 | /* This part needs to be executed always for OMAP34xx */ | 739 | /* This part needs to be executed always for OMAP34xx */ |
736 | if (cpu_is_omap34xx() || (bank->non_wakeup_gpios & gpio_bit)) { | 740 | if (cpu_is_omap34xx() || (bank->non_wakeup_gpios & gpio_bit)) { |
737 | if (trigger != 0) | 741 | /* |
742 | * Log the edge gpio and manually trigger the IRQ | ||
743 | * after resume if the input level changes | ||
744 | * to avoid irq lost during PER RET/OFF mode | ||
745 | * Applies for omap2 non-wakeup gpio and all omap3 gpios | ||
746 | */ | ||
747 | if (trigger & IRQ_TYPE_EDGE_BOTH) | ||
738 | bank->enabled_non_wakeup_gpios |= gpio_bit; | 748 | bank->enabled_non_wakeup_gpios |= gpio_bit; |
739 | else | 749 | else |
740 | bank->enabled_non_wakeup_gpios &= ~gpio_bit; | 750 | bank->enabled_non_wakeup_gpios &= ~gpio_bit; |