aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorKevin Hilman <khilman@deeprootsystems.com>2009-01-27 14:15:34 -0500
committerKevin Hilman <khilman@deeprootsystems.com>2010-05-12 12:39:16 -0400
commit8865b9b6d5e1601453ea20c37eb981c6ccc3f4e9 (patch)
tree88c8f10530aee0eea7c7f6be80cccf727e26bb11 /arch
parent43ffcd9a042858a9e9f9fe014bb073e55db34c67 (diff)
OMAP3: GPIO: disable GPIO debounce clocks on idle
Ensure GPIO debounce clocks are disabled when idle. Otherwise, clocks will prevent PER powerdomain from entering retention. Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/plat-omap/gpio.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 1c81340ce65..c6e1de52711 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -196,6 +196,7 @@ struct gpio_bank {
196 struct gpio_chip chip; 196 struct gpio_chip chip;
197 struct clk *dbck; 197 struct clk *dbck;
198 u32 mod_usage; 198 u32 mod_usage;
199 u32 dbck_enable_mask;
199}; 200};
200 201
201#define METHOD_MPUIO 0 202#define METHOD_MPUIO 0
@@ -647,6 +648,7 @@ void omap_set_gpio_debounce(int gpio, int enable)
647 goto done; 648 goto done;
648 649
649 if (cpu_is_omap34xx() || cpu_is_omap44xx()) { 650 if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
651 bank->dbck_enable_mask = val;
650 if (enable) 652 if (enable)
651 clk_enable(bank->dbck); 653 clk_enable(bank->dbck);
652 else 654 else
@@ -2054,6 +2056,9 @@ void omap2_gpio_prepare_for_idle(int power_state)
2054 struct gpio_bank *bank = &gpio_bank[i]; 2056 struct gpio_bank *bank = &gpio_bank[i];
2055 u32 l1, l2; 2057 u32 l1, l2;
2056 2058
2059 if (bank->dbck_enable_mask)
2060 clk_disable(bank->dbck);
2061
2057 if (power_state > PWRDM_POWER_OFF) 2062 if (power_state > PWRDM_POWER_OFF)
2058 continue; 2063 continue;
2059 2064
@@ -2118,6 +2123,9 @@ void omap2_gpio_resume_after_idle(void)
2118 struct gpio_bank *bank = &gpio_bank[i]; 2123 struct gpio_bank *bank = &gpio_bank[i];
2119 u32 l, gen, gen0, gen1; 2124 u32 l, gen, gen0, gen1;
2120 2125
2126 if (bank->dbck_enable_mask)
2127 clk_enable(bank->dbck);
2128
2121 if (!workaround_enabled) 2129 if (!workaround_enabled)
2122 continue; 2130 continue;
2123 2131