提交 1bac282a 编写于 作者: B Ben Dooks 提交者: Kukjin Kim

ARM: SAMSUNG: Add support for pre-sleep/post-restore gpio control

Add a callback so that per-arch can do pre-sleep and post-resume
gpio configuration so that for the S3C64XX, the GPIO configuration
is restored before the sleep mode is cleared.

For the S3C64XX case, it means that the GPIOs get set back to normal
operation after the restore code puts the original configurations
back in after the
Signed-off-by: NBen Dooks <ben-linux@fluff.org>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: NKukjin Kim <kgene.kim@samsung.com>
上级 c17afc0a
...@@ -62,3 +62,6 @@ static inline void s3c_pm_arch_update_uart(void __iomem *regs, ...@@ -62,3 +62,6 @@ static inline void s3c_pm_arch_update_uart(void __iomem *regs,
struct pm_uart_save *save) struct pm_uart_save *save)
{ {
} }
static inline void s3c_pm_restored_gpios(void) { }
static inline void s3c_pm_saved_gpios(void) { }
...@@ -96,3 +96,20 @@ static inline void s3c_pm_arch_update_uart(void __iomem *regs, ...@@ -96,3 +96,20 @@ static inline void s3c_pm_arch_update_uart(void __iomem *regs,
save->ucon = new_ucon; save->ucon = new_ucon;
} }
} }
static inline void s3c_pm_restored_gpios(void)
{
/* ensure sleep mode has been cleared from the system */
__raw_writel(0, S3C64XX_SLPEN);
}
static inline void s3c_pm_saved_gpios(void)
{
/* turn on the sleep mode and keep it there, as it seems that during
* suspend the xCON registers get re-set and thus you can end up with
* problems between going to sleep and resuming.
*/
__raw_writel(S3C64XX_SLPEN_USE_xSLP, S3C64XX_SLPEN);
}
...@@ -41,3 +41,6 @@ static inline void s3c_pm_arch_update_uart(void __iomem *regs, ...@@ -41,3 +41,6 @@ static inline void s3c_pm_arch_update_uart(void __iomem *regs,
{ {
/* nothing here yet */ /* nothing here yet */
} }
static inline void s3c_pm_restored_gpios(void) { }
static inline void s3c_pm_saved_gpios(void) { }
...@@ -268,6 +268,7 @@ static int s3c_pm_enter(suspend_state_t state) ...@@ -268,6 +268,7 @@ static int s3c_pm_enter(suspend_state_t state)
/* save all necessary core registers not covered by the drivers */ /* save all necessary core registers not covered by the drivers */
s3c_pm_save_gpios(); s3c_pm_save_gpios();
s3c_pm_saved_gpios();
s3c_pm_save_uarts(); s3c_pm_save_uarts();
s3c_pm_save_core(); s3c_pm_save_core();
...@@ -309,6 +310,7 @@ static int s3c_pm_enter(suspend_state_t state) ...@@ -309,6 +310,7 @@ static int s3c_pm_enter(suspend_state_t state)
s3c_pm_restore_core(); s3c_pm_restore_core();
s3c_pm_restore_uarts(); s3c_pm_restore_uarts();
s3c_pm_restore_gpios(); s3c_pm_restore_gpios();
s3c_pm_restored_gpios();
s3c_pm_debug_init(); s3c_pm_debug_init();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册