提交 ae547354 编写于 作者: N Nishanth Menon 提交者: Tarun Kanti DebBarma

gpio/omap: save and restore debounce registers

GPIO debounce registers need to be saved and restored for proper functioning
of driver.
Signed-off-by: NNishanth 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: NTarun Kanti DebBarma <tarun.kanti@ti.com>
Reviewed-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
Reviewed-by: NKevin Hilman <khilman@ti.com>
Signed-off-by: NKevin Hilman <khilman@ti.com>
上级 41d87cbd
...@@ -44,6 +44,8 @@ struct gpio_regs { ...@@ -44,6 +44,8 @@ struct gpio_regs {
u32 risingdetect; u32 risingdetect;
u32 fallingdetect; u32 fallingdetect;
u32 dataout; u32 dataout;
u32 debounce;
u32 debounce_en;
}; };
struct gpio_bank { struct gpio_bank {
...@@ -229,6 +231,10 @@ static void _set_gpio_debounce(struct gpio_bank *bank, unsigned gpio, ...@@ -229,6 +231,10 @@ static void _set_gpio_debounce(struct gpio_bank *bank, unsigned gpio,
* that point. Therefore we have to enable dbck here. * that point. Therefore we have to enable dbck here.
*/ */
_gpio_dbck_enable(bank); _gpio_dbck_enable(bank);
if (bank->dbck_enable_mask) {
bank->context.debounce = debounce;
bank->context.debounce_en = val;
}
} }
static inline void set_gpio_trigger(struct gpio_bank *bank, int gpio, 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,6 +1369,12 @@ static void omap_gpio_restore_context(struct gpio_bank *bank)
__raw_writel(bank->context.fallingdetect, __raw_writel(bank->context.fallingdetect,
bank->base + bank->regs->fallingdetect); bank->base + bank->regs->fallingdetect);
__raw_writel(bank->context.dataout, bank->base + bank->regs->dataout); __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);
}
} }
#endif /* CONFIG_PM_RUNTIME */ #endif /* CONFIG_PM_RUNTIME */
#else #else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册