diff options
author | Grazvydas Ignotas <notasas@gmail.com> | 2012-06-16 15:01:25 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2012-06-26 22:08:49 -0400 |
commit | 9e303f228c24d529bf479196d290eedc2a04cd5e (patch) | |
tree | a88c525dae15385174a5ed0adc077ec6cf6bd36e /drivers/gpio | |
parent | 6b16351acbd415e66ba16bf7d473ece1574cf0bc (diff) |
gpio/omap: fix irq loss while in idle with debounce on
It seems that currently GPIO module is not working correctly during idle
when debounce is enabled - the system almost never responds to button
presses (observed on OMAP3530 ES2.1 and OMAP3630 ES1.2 pandora boards).
Even though wakeups are probably working, it seems that the GPIO module
itself is unable to detect input events and generate interrupts.
OMAP35x TRM also states that:
"If the debounce clock is inactive, the debounce cell gates all
input signals and thus cannot be used."
So whenever we are disabling debounce clocks (for PM or other reasons),
be sure the module's debounce feature is disabled too.
Cc: Kevin Hilman <khilman@ti.com>
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-omap.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index c4ed1722734c..ff213e70fa5a 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c | |||
@@ -174,12 +174,22 @@ static inline void _gpio_dbck_enable(struct gpio_bank *bank) | |||
174 | if (bank->dbck_enable_mask && !bank->dbck_enabled) { | 174 | if (bank->dbck_enable_mask && !bank->dbck_enabled) { |
175 | clk_enable(bank->dbck); | 175 | clk_enable(bank->dbck); |
176 | bank->dbck_enabled = true; | 176 | bank->dbck_enabled = true; |
177 | |||
178 | __raw_writel(bank->dbck_enable_mask, | ||
179 | bank->base + bank->regs->debounce_en); | ||
177 | } | 180 | } |
178 | } | 181 | } |
179 | 182 | ||
180 | static inline void _gpio_dbck_disable(struct gpio_bank *bank) | 183 | static inline void _gpio_dbck_disable(struct gpio_bank *bank) |
181 | { | 184 | { |
182 | if (bank->dbck_enable_mask && bank->dbck_enabled) { | 185 | if (bank->dbck_enable_mask && bank->dbck_enabled) { |
186 | /* | ||
187 | * Disable debounce before cutting it's clock. If debounce is | ||
188 | * enabled but the clock is not, GPIO module seems to be unable | ||
189 | * to detect events and generate interrupts at least on OMAP3. | ||
190 | */ | ||
191 | __raw_writel(0, bank->base + bank->regs->debounce_en); | ||
192 | |||
183 | clk_disable(bank->dbck); | 193 | clk_disable(bank->dbck); |
184 | bank->dbck_enabled = false; | 194 | bank->dbck_enabled = false; |
185 | } | 195 | } |