diff options
author | Tarun Kanti DebBarma <tarun.kanti@ti.com> | 2012-04-27 10:13:38 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2012-05-11 20:08:40 -0400 |
commit | 1b1287032df3a69d3ef9a486b444f4ffcca50d01 (patch) | |
tree | 7b714cfdfb8d2a41d0947fb7e6d05ae019b12e2f /drivers/gpio | |
parent | 4e962e8998cc6cb5e58beae5feb6a65cb1a27f26 (diff) |
gpio/omap: fix missing check in *_runtime_suspend()
We do checking for bank->enabled_non_wakeup_gpios in order
to skip redundant operations. Somehow, the check got missed
while doing the cleanup series.
Just to make sure that we do context restore correctly in
*_runtime_resume(), the bank->workaround_enabled check is
moved after context restore. Otherwise, it would prevent
context restore when bank->enabled_non_wakeup_gpios is 0.
Cc: Kevin Hilman <khilman@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Cousson, Benoit <b-cousson@ti.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Tarun Kanti DebBarma <tarun.kanti@ti.com>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-omap.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 2c70617e6b45..9b71f04538aa 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c | |||
@@ -1157,6 +1157,9 @@ static int omap_gpio_runtime_suspend(struct device *dev) | |||
1157 | 1157 | ||
1158 | spin_lock_irqsave(&bank->lock, flags); | 1158 | spin_lock_irqsave(&bank->lock, flags); |
1159 | 1159 | ||
1160 | if (!bank->enabled_non_wakeup_gpios) | ||
1161 | goto update_gpio_context_count; | ||
1162 | |||
1160 | /* | 1163 | /* |
1161 | * Only edges can generate a wakeup event to the PRCM. | 1164 | * Only edges can generate a wakeup event to the PRCM. |
1162 | * | 1165 | * |
@@ -1232,11 +1235,6 @@ static int omap_gpio_runtime_resume(struct device *dev) | |||
1232 | __raw_writel(bank->context.risingdetect, | 1235 | __raw_writel(bank->context.risingdetect, |
1233 | bank->base + bank->regs->risingdetect); | 1236 | bank->base + bank->regs->risingdetect); |
1234 | 1237 | ||
1235 | if (!bank->workaround_enabled) { | ||
1236 | spin_unlock_irqrestore(&bank->lock, flags); | ||
1237 | return 0; | ||
1238 | } | ||
1239 | |||
1240 | if (bank->get_context_loss_count) { | 1238 | if (bank->get_context_loss_count) { |
1241 | context_lost_cnt_after = | 1239 | context_lost_cnt_after = |
1242 | bank->get_context_loss_count(bank->dev); | 1240 | bank->get_context_loss_count(bank->dev); |
@@ -1249,6 +1247,11 @@ static int omap_gpio_runtime_resume(struct device *dev) | |||
1249 | } | 1247 | } |
1250 | } | 1248 | } |
1251 | 1249 | ||
1250 | if (!bank->workaround_enabled) { | ||
1251 | spin_unlock_irqrestore(&bank->lock, flags); | ||
1252 | return 0; | ||
1253 | } | ||
1254 | |||
1252 | __raw_writel(bank->context.fallingdetect, | 1255 | __raw_writel(bank->context.fallingdetect, |
1253 | bank->base + bank->regs->fallingdetect); | 1256 | bank->base + bank->regs->fallingdetect); |
1254 | __raw_writel(bank->context.risingdetect, | 1257 | __raw_writel(bank->context.risingdetect, |