aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/gpio.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@deeprootsystems.com>2010-09-22 19:06:27 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2010-09-23 20:14:17 -0400
commit0aed043517ad4135cb458a46e9e99e21cbb59c69 (patch)
tree72fe011933f0e8a66fcb10026d9fe593c282d578 /arch/arm/plat-omap/gpio.c
parentcbf27660e692d8c74087c0ccb80225207d280af1 (diff)
OMAP: GPIO: ensure debounce clocks are disabled during idle/suspend
If a GPIO bank has more than one GPIO with debounce enabled, the debounce clock will not be fully disabled before going to idle/suspend. In the idle path, we just do a single clk_disable() of the bank's debounce clock. If there are multiple debounce-enabled GPIOs in the bank, that clocks usage count will be > 1, so the clk_disable() will not actually disable the clock. So the fix is to clk_disable() for every debounce-enabled GPIO in the bank (and an equivalent clk_enable() of course.) Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/plat-omap/gpio.c')
-rw-r--r--arch/arm/plat-omap/gpio.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 7951eefe1a0e..11c5b0eefb85 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -2085,8 +2085,9 @@ void omap2_gpio_prepare_for_idle(int power_state)
2085 for (i = min; i < gpio_bank_count; i++) { 2085 for (i = min; i < gpio_bank_count; i++) {
2086 struct gpio_bank *bank = &gpio_bank[i]; 2086 struct gpio_bank *bank = &gpio_bank[i];
2087 u32 l1, l2; 2087 u32 l1, l2;
2088 int j;
2088 2089
2089 if (bank->dbck_enable_mask) 2090 for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++)
2090 clk_disable(bank->dbck); 2091 clk_disable(bank->dbck);
2091 2092
2092 if (power_state > PWRDM_POWER_OFF) 2093 if (power_state > PWRDM_POWER_OFF)
@@ -2152,8 +2153,9 @@ void omap2_gpio_resume_after_idle(void)
2152 for (i = min; i < gpio_bank_count; i++) { 2153 for (i = min; i < gpio_bank_count; i++) {
2153 struct gpio_bank *bank = &gpio_bank[i]; 2154 struct gpio_bank *bank = &gpio_bank[i];
2154 u32 l, gen, gen0, gen1; 2155 u32 l, gen, gen0, gen1;
2156 int j;
2155 2157
2156 if (bank->dbck_enable_mask) 2158 for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++)
2157 clk_enable(bank->dbck); 2159 clk_enable(bank->dbck);
2158 2160
2159 if (!workaround_enabled) 2161 if (!workaround_enabled)