diff options
author | Nishanth Menon <nm@ti.com> | 2011-08-08 20:31:44 -0500 |
---|---|---|
committer | Nishanth Menon <nm@ti.com> | 2011-08-29 19:35:14 -0500 |
commit | 8f9daece4bae3efb7306babf74262e8f9ff5e5de (patch) | |
tree | 7ecfb60ee617b173b36b291be1dcecc9796194ec /drivers/gpio | |
parent | f5f231c3685c31fdbbd6d91ca540fb4034fb731a (diff) | |
download | kernel_samsung_tuna-8f9daece4bae3efb7306babf74262e8f9ff5e5de.zip kernel_samsung_tuna-8f9daece4bae3efb7306babf74262e8f9ff5e5de.tar.gz kernel_samsung_tuna-8f9daece4bae3efb7306babf74262e8f9ff5e5de.tar.bz2 |
GPIO: OMAP: save and restore debounce as well
GPIO debounce needs to be saved and restored as well
for proper restoration for driver expectation. To save
the registers, we cannot cut the clock before the save,
hence move the clk disable after the save.
Change-Id: I902ca8a4ab9750c49413f20a5782eb31f9241f1c
Signed-off-by: Nishanth Menon <nm@ti.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-omap.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index af0c7e2..3da9d53 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -41,6 +41,8 @@ struct gpio_regs { u32 risingdetect; u32 fallingdetect; u32 dataout; + u32 debounce; + u32 debounce_en; }; struct gpio_bank { @@ -1263,9 +1265,6 @@ static int omap_gpio_pm_runtime_suspend(struct device *dev) u32 l1 = 0, l2 = 0; int j; - for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++) - clk_disable(bank->dbck); - /* If going to OFF, remove triggering for all * non-wakeup GPIOs. Otherwise spurious IRQs will be * generated. See OMAP2420 Errata item 1.101. */ @@ -1289,6 +1288,9 @@ save_gpio_ctx: if (bank->get_context_loss_count) bank->ctx_loss_count = bank->get_context_loss_count(bank->dev); omap_gpio_save_context(bank); + for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++) + clk_disable(bank->dbck); + #endif return 0; } @@ -1426,6 +1428,12 @@ 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); + if (bank->dbck_enable_mask) { + bank->context.debounce = __raw_readl(bank->base + + bank->regs->debounce); + bank->context.debounce_en = __raw_readl(bank->base + + bank->regs->debounce_en); + } bank->saved_context = 1; } @@ -1450,6 +1458,12 @@ void omap_gpio_restore_context(struct gpio_bank *bank) __raw_writel(bank->context.fallingdetect, bank->base + bank->regs->fallingdetect); __raw_writel(bank->context.dataout, bank->base + bank->regs->dataout); + if (bank->dbck_enable_mask) { + __raw_writel(bank->context.debounce, bank->base + + bank->regs->debounce); + __raw_writel(bank->context.debounce_en, + bank->base + bank->regs->debounce_en); + } bank->saved_context = 0; } #endif |