diff options
Diffstat (limited to 'arch/arm/plat-omap/gpio.c')
-rw-r--r-- | arch/arm/plat-omap/gpio.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c index 2f185ffaca4a..1c81340ce65c 100644 --- a/arch/arm/plat-omap/gpio.c +++ b/arch/arm/plat-omap/gpio.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <mach/irqs.h> | 27 | #include <mach/irqs.h> |
28 | #include <mach/gpio.h> | 28 | #include <mach/gpio.h> |
29 | #include <asm/mach/irq.h> | 29 | #include <asm/mach/irq.h> |
30 | #include <plat/powerdomain.h> | ||
30 | 31 | ||
31 | /* | 32 | /* |
32 | * OMAP1510 GPIO registers | 33 | * OMAP1510 GPIO registers |
@@ -2041,19 +2042,24 @@ static struct sys_device omap_gpio_device = { | |||
2041 | 2042 | ||
2042 | static int workaround_enabled; | 2043 | static int workaround_enabled; |
2043 | 2044 | ||
2044 | void omap2_gpio_prepare_for_retention(void) | 2045 | void omap2_gpio_prepare_for_idle(int power_state) |
2045 | { | 2046 | { |
2046 | int i, c = 0; | 2047 | int i, c = 0; |
2047 | int min = 0; | 2048 | int min = 0; |
2048 | 2049 | ||
2049 | if (cpu_is_omap34xx()) | 2050 | if (cpu_is_omap34xx()) |
2050 | min = 1; | 2051 | min = 1; |
2051 | /* Remove triggering for all non-wakeup GPIOs. Otherwise spurious | 2052 | |
2052 | * IRQs will be generated. See OMAP2420 Errata item 1.101. */ | ||
2053 | for (i = min; i < gpio_bank_count; i++) { | 2053 | for (i = min; i < gpio_bank_count; i++) { |
2054 | struct gpio_bank *bank = &gpio_bank[i]; | 2054 | struct gpio_bank *bank = &gpio_bank[i]; |
2055 | u32 l1, l2; | 2055 | u32 l1, l2; |
2056 | 2056 | ||
2057 | if (power_state > PWRDM_POWER_OFF) | ||
2058 | continue; | ||
2059 | |||
2060 | /* If going to OFF, remove triggering for all | ||
2061 | * non-wakeup GPIOs. Otherwise spurious IRQs will be | ||
2062 | * generated. See OMAP2420 Errata item 1.101. */ | ||
2057 | if (!(bank->enabled_non_wakeup_gpios)) | 2063 | if (!(bank->enabled_non_wakeup_gpios)) |
2058 | continue; | 2064 | continue; |
2059 | 2065 | ||
@@ -2101,19 +2107,20 @@ void omap2_gpio_prepare_for_retention(void) | |||
2101 | workaround_enabled = 1; | 2107 | workaround_enabled = 1; |
2102 | } | 2108 | } |
2103 | 2109 | ||
2104 | void omap2_gpio_resume_after_retention(void) | 2110 | void omap2_gpio_resume_after_idle(void) |
2105 | { | 2111 | { |
2106 | int i; | 2112 | int i; |
2107 | int min = 0; | 2113 | int min = 0; |
2108 | 2114 | ||
2109 | if (!workaround_enabled) | ||
2110 | return; | ||
2111 | if (cpu_is_omap34xx()) | 2115 | if (cpu_is_omap34xx()) |
2112 | min = 1; | 2116 | min = 1; |
2113 | for (i = min; i < gpio_bank_count; i++) { | 2117 | for (i = min; i < gpio_bank_count; i++) { |
2114 | struct gpio_bank *bank = &gpio_bank[i]; | 2118 | struct gpio_bank *bank = &gpio_bank[i]; |
2115 | u32 l, gen, gen0, gen1; | 2119 | u32 l, gen, gen0, gen1; |
2116 | 2120 | ||
2121 | if (!workaround_enabled) | ||
2122 | continue; | ||
2123 | |||
2117 | if (!(bank->enabled_non_wakeup_gpios)) | 2124 | if (!(bank->enabled_non_wakeup_gpios)) |
2118 | continue; | 2125 | continue; |
2119 | 2126 | ||