diff options
author | Axel Haslam <axelhaslam@ti.com> | 2011-07-06 23:17:25 -0500 |
---|---|---|
committer | Nishanth Menon <nm@ti.com> | 2011-07-14 11:53:48 -0700 |
commit | 79cc5075831eaaebeec13d62f32074b6a978fe7c (patch) | |
tree | b669125cf543acc9d4fca07fbc6da7802f008ca5 /drivers/gpio | |
parent | e03ddf8148db55f98b22e05cf2db93fb6e858b43 (diff) | |
download | kernel_samsung_tuna-79cc5075831eaaebeec13d62f32074b6a978fe7c.zip kernel_samsung_tuna-79cc5075831eaaebeec13d62f32074b6a978fe7c.tar.gz kernel_samsung_tuna-79cc5075831eaaebeec13d62f32074b6a978fe7c.tar.bz2 |
GPIO: OMAP: restore context only if previously saved
On probe a call to runtime get sync will eventualy
result in a context restore. We do not want to
restore any context, if it was never saved on
the first place.
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Axel Haslam <axelhaslam@ti.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-omap.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 1e20f00..d087fdf 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -69,6 +69,7 @@ struct gpio_bank { bool dbck_flag; bool loses_context; bool suspend_support; + bool saved_context; int stride; u32 width; u32 ctx_loss_count; @@ -1136,7 +1137,7 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev) bank->loses_context = pdata->loses_context; bank->regs = pdata->regs; bank->get_context_loss_count = pdata->get_context_loss_count; - + bank->saved_context = 0; if (bank->regs->set_dataout && bank->regs->clr_dataout) bank->set_dataout = _set_gpio_dataout_reg; else @@ -1405,7 +1406,6 @@ void omap2_gpio_resume_after_idle(void) __func__, bank->id); } } - void omap_gpio_save_context(struct gpio_bank *bank) { bank->context.irqenable1 = @@ -1425,10 +1425,13 @@ void omap_gpio_save_context(struct gpio_bank *bank) bank->context.fallingdetect = __raw_readl(bank->base + bank->regs->fallingdetect); bank->context.dataout = __raw_readl(bank->base + bank->regs->dataout); + bank->saved_context = 1; } void omap_gpio_restore_context(struct gpio_bank *bank) { + if(!bank->saved_context) + return; __raw_writel(bank->context.irqenable1, bank->base + bank->regs->irqenable); __raw_writel(bank->context.irqenable2, |