gpio/omap: fix debounce clock handling
Subsystems (2)
PATCH 1/1 gpio/omap: fix debounce clock handling
GPIO debounce clock can gate the PER power domain transition and needs to be disabled in GPIO driver suspend.
The debounce clock is not getting disabled in runtime_suspend callback because of an un-necessary bank->mod_usage check. In omap_gpio_suspend/resume too, there is no need to do any operation if the gpio bank is not used.
Remove the un-necessary bank->mod_usage check from suspend callbacks.
Thanks to Kevin Hilman for pointing out this issue.
--- drivers/gpio/gpio-omap.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
drivers/gpio/gpio-omap.c +6 -0
@@ -1107,6 +1107,9 @@ static int omap_gpio_suspend(struct device *dev)void __iomem *wake_status;unsigned long flags; +if (!bank->mod_usage || !bank->loses_context) +return 0 ; +if (!bank->regs->wkup_en || !bank->suspend_wakeup)return 0 ;
@@ -1128,6 +1131,9 @@ static int omap_gpio_resume(struct device *dev) void __iomem *base =3D bank->base;unsigned long flags; +if (!bank->mod_usage || !bank->loses_context) +return 0 ; +if (!bank->regs->wkup_en || !bank->saved_wakeup)return 0 ;
@@ -1151,9 +1157,6 @@ static int omap_gpio_runtime_suspend(struct device *d=
ev)
int j;
unsigned long flags;
- if (!bank->mod_usage)
- return 0;
-
spin_lock_irqsave(&bank->lock, flags);
/*
* If going to OFF, remove triggering for all
@@ -1199,9 +1202,6 @@ static int omap_gpio_runtime_resume(struct device *de=
v)
int j;
unsigned long flags;
- if (!bank->mod_usage)
- return 0;
-
spin_lock_irqsave(&bank->lock, flags);
for (j =3D 0; j < hweight_long(bank->dbck_enable_mask); j++)
clk_enable(bank->dbck);
--=20
1.7.0.4