diff options
author | Nishanth Menon <nm@ti.com> | 2011-09-09 09:38:58 -0400 |
---|---|---|
committer | Tarun Kanti DebBarma <tarun.kanti@ti.com> | 2012-02-06 06:24:37 -0500 |
commit | ae547354a8ed59f19b57f7e1de9c7816edfc3537 (patch) | |
tree | a8069213450d93f22611804628251d7c785a6266 | |
parent | 41d87cbd660fd5793a6c70f9c93d9dcc8964179d (diff) |
gpio/omap: save and restore debounce registers
GPIO debounce registers need to be saved and restored for proper functioning
of driver.
Signed-off-by: Nishanth Menon <nm@ti.com>
tarun.kanti@ti.com: Debounce context save is moved to _set_gpio_debounce()
as part of dynamic context save to remove overhead.
Signed-off-by: Tarun Kanti DebBarma <tarun.kanti@ti.com>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
-rw-r--r-- | drivers/gpio/gpio-omap.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 62c49e0f7f29..f6b2c51b2935 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c | |||
@@ -44,6 +44,8 @@ struct gpio_regs { | |||
44 | u32 risingdetect; | 44 | u32 risingdetect; |
45 | u32 fallingdetect; | 45 | u32 fallingdetect; |
46 | u32 dataout; | 46 | u32 dataout; |
47 | u32 debounce; | ||
48 | u32 debounce_en; | ||
47 | }; | 49 | }; |
48 | 50 | ||
49 | struct gpio_bank { | 51 | struct gpio_bank { |
@@ -229,6 +231,10 @@ static void _set_gpio_debounce(struct gpio_bank *bank, unsigned gpio, | |||
229 | * that point. Therefore we have to enable dbck here. | 231 | * that point. Therefore we have to enable dbck here. |
230 | */ | 232 | */ |
231 | _gpio_dbck_enable(bank); | 233 | _gpio_dbck_enable(bank); |
234 | if (bank->dbck_enable_mask) { | ||
235 | bank->context.debounce = debounce; | ||
236 | bank->context.debounce_en = val; | ||
237 | } | ||
232 | } | 238 | } |
233 | 239 | ||
234 | static inline void set_gpio_trigger(struct gpio_bank *bank, int gpio, | 240 | static inline void set_gpio_trigger(struct gpio_bank *bank, int gpio, |
@@ -1363,6 +1369,12 @@ static void omap_gpio_restore_context(struct gpio_bank *bank) | |||
1363 | __raw_writel(bank->context.fallingdetect, | 1369 | __raw_writel(bank->context.fallingdetect, |
1364 | bank->base + bank->regs->fallingdetect); | 1370 | bank->base + bank->regs->fallingdetect); |
1365 | __raw_writel(bank->context.dataout, bank->base + bank->regs->dataout); | 1371 | __raw_writel(bank->context.dataout, bank->base + bank->regs->dataout); |
1372 | if (bank->dbck_enable_mask) { | ||
1373 | __raw_writel(bank->context.debounce, bank->base + | ||
1374 | bank->regs->debounce); | ||
1375 | __raw_writel(bank->context.debounce_en, | ||
1376 | bank->base + bank->regs->debounce_en); | ||
1377 | } | ||
1366 | } | 1378 | } |
1367 | #endif /* CONFIG_PM_RUNTIME */ | 1379 | #endif /* CONFIG_PM_RUNTIME */ |
1368 | #else | 1380 | #else |