* [PATCH] ARM: SAMSUNG: Add support for pre-sleep/post-restore gpio control
@ 2011-04-27 17:34 Mark Brown
2011-05-06 5:02 ` Kukjin Kim
0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2011-04-27 17:34 UTC (permalink / raw)
To: linux-arm-kernel
From: Ben Dooks <ben-linux@fluff.org>
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: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
arch/arm/mach-s3c2410/include/mach/pm-core.h | 3 +++
arch/arm/mach-s3c64xx/include/mach/pm-core.h | 17 +++++++++++++++++
arch/arm/mach-s5pv210/include/mach/pm-core.h | 3 +++
arch/arm/plat-samsung/pm.c | 2 ++
4 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s3c2410/include/mach/pm-core.h b/arch/arm/mach-s3c2410/include/mach/pm-core.h
index 70a83b2..45eea52 100644
--- a/arch/arm/mach-s3c2410/include/mach/pm-core.h
+++ b/arch/arm/mach-s3c2410/include/mach/pm-core.h
@@ -62,3 +62,6 @@ static inline void s3c_pm_arch_update_uart(void __iomem *regs,
struct pm_uart_save *save)
{
}
+
+static inline void s3c_pm_restored_gpios(void) { }
+static inline void s3c_pm_saved_gpios(void) { }
diff --git a/arch/arm/mach-s3c64xx/include/mach/pm-core.h b/arch/arm/mach-s3c64xx/include/mach/pm-core.h
index 4ed0f58..38659be 100644
--- a/arch/arm/mach-s3c64xx/include/mach/pm-core.h
+++ b/arch/arm/mach-s3c64xx/include/mach/pm-core.h
@@ -96,3 +96,20 @@ static inline void s3c_pm_arch_update_uart(void __iomem *regs,
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);
+}
diff --git a/arch/arm/mach-s5pv210/include/mach/pm-core.h b/arch/arm/mach-s5pv210/include/mach/pm-core.h
index e8d394f..3e22109 100644
--- a/arch/arm/mach-s5pv210/include/mach/pm-core.h
+++ b/arch/arm/mach-s5pv210/include/mach/pm-core.h
@@ -41,3 +41,6 @@ static inline void s3c_pm_arch_update_uart(void __iomem *regs,
{
/* nothing here yet */
}
+
+static inline void s3c_pm_restored_gpios(void) { }
+static inline void s3c_pm_saved_gpios(void) { }
diff --git a/arch/arm/plat-samsung/pm.c b/arch/arm/plat-samsung/pm.c
index 5c0a440..4f9a951 100644
--- a/arch/arm/plat-samsung/pm.c
+++ b/arch/arm/plat-samsung/pm.c
@@ -268,6 +268,7 @@ static int s3c_pm_enter(suspend_state_t state)
/* save all necessary core registers not covered by the drivers */
s3c_pm_save_gpios();
+ s3c_pm_saved_gpios();
s3c_pm_save_uarts();
s3c_pm_save_core();
@@ -309,6 +310,7 @@ static int s3c_pm_enter(suspend_state_t state)
s3c_pm_restore_core();
s3c_pm_restore_uarts();
s3c_pm_restore_gpios();
+ s3c_pm_restored_gpios();
s3c_pm_debug_init();
--
1.7.4.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] ARM: SAMSUNG: Add support for pre-sleep/post-restore gpio control
2011-04-27 17:34 [PATCH] ARM: SAMSUNG: Add support for pre-sleep/post-restore gpio control Mark Brown
@ 2011-05-06 5:02 ` Kukjin Kim
2011-06-07 6:50 ` Marek Szyprowski
0 siblings, 1 reply; 5+ messages in thread
From: Kukjin Kim @ 2011-05-06 5:02 UTC (permalink / raw)
To: linux-arm-kernel
Mark Brown wrote:
>
> From: Ben Dooks <ben-linux@fluff.org>
>
> 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: Ben Dooks <ben-linux@fluff.org>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
> arch/arm/mach-s3c2410/include/mach/pm-core.h | 3 +++
> arch/arm/mach-s3c64xx/include/mach/pm-core.h | 17 +++++++++++++++++
> arch/arm/mach-s5pv210/include/mach/pm-core.h | 3 +++
> arch/arm/plat-samsung/pm.c | 2 ++
> 4 files changed, 25 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-s3c2410/include/mach/pm-core.h b/arch/arm/mach-
> s3c2410/include/mach/pm-core.h
> index 70a83b2..45eea52 100644
> --- a/arch/arm/mach-s3c2410/include/mach/pm-core.h
> +++ b/arch/arm/mach-s3c2410/include/mach/pm-core.h
> @@ -62,3 +62,6 @@ static inline void s3c_pm_arch_update_uart(void __iomem
> *regs,
> struct pm_uart_save *save)
> {
> }
> +
> +static inline void s3c_pm_restored_gpios(void) { }
> +static inline void s3c_pm_saved_gpios(void) { }
> diff --git a/arch/arm/mach-s3c64xx/include/mach/pm-core.h b/arch/arm/mach-
> s3c64xx/include/mach/pm-core.h
> index 4ed0f58..38659be 100644
> --- a/arch/arm/mach-s3c64xx/include/mach/pm-core.h
> +++ b/arch/arm/mach-s3c64xx/include/mach/pm-core.h
> @@ -96,3 +96,20 @@ static inline void s3c_pm_arch_update_uart(void __iomem
> *regs,
> 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);
> +}
> diff --git a/arch/arm/mach-s5pv210/include/mach/pm-core.h b/arch/arm/mach-
> s5pv210/include/mach/pm-core.h
> index e8d394f..3e22109 100644
> --- a/arch/arm/mach-s5pv210/include/mach/pm-core.h
> +++ b/arch/arm/mach-s5pv210/include/mach/pm-core.h
> @@ -41,3 +41,6 @@ static inline void s3c_pm_arch_update_uart(void __iomem
> *regs,
> {
> /* nothing here yet */
> }
> +
> +static inline void s3c_pm_restored_gpios(void) { }
> +static inline void s3c_pm_saved_gpios(void) { }
> diff --git a/arch/arm/plat-samsung/pm.c b/arch/arm/plat-samsung/pm.c
> index 5c0a440..4f9a951 100644
> --- a/arch/arm/plat-samsung/pm.c
> +++ b/arch/arm/plat-samsung/pm.c
> @@ -268,6 +268,7 @@ static int s3c_pm_enter(suspend_state_t state)
> /* save all necessary core registers not covered by the drivers */
>
> s3c_pm_save_gpios();
> + s3c_pm_saved_gpios();
> s3c_pm_save_uarts();
> s3c_pm_save_core();
>
> @@ -309,6 +310,7 @@ static int s3c_pm_enter(suspend_state_t state)
> s3c_pm_restore_core();
> s3c_pm_restore_uarts();
> s3c_pm_restore_gpios();
> + s3c_pm_restored_gpios();
>
> s3c_pm_debug_init();
>
> --
> 1.7.4.1
Ok, will apply.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ARM: SAMSUNG: Add support for pre-sleep/post-restore gpio control
2011-05-06 5:02 ` Kukjin Kim
@ 2011-06-07 6:50 ` Marek Szyprowski
2011-06-09 21:41 ` Kukjin Kim
0 siblings, 1 reply; 5+ messages in thread
From: Marek Szyprowski @ 2011-06-07 6:50 UTC (permalink / raw)
To: linux-arm-kernel
Hello,
On Friday, May 06, 2011 7:03 AM Kukjin Kim wrote:
> Mark Brown wrote:
> >
> > From: Ben Dooks <ben-linux@fluff.org>
> >
> > 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: Ben Dooks <ben-linux@fluff.org>
> > Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> > ---
> > arch/arm/mach-s3c2410/include/mach/pm-core.h | 3 +++
> > arch/arm/mach-s3c64xx/include/mach/pm-core.h | 17 +++++++++++++++++
> > arch/arm/mach-s5pv210/include/mach/pm-core.h | 3 +++
> > arch/arm/plat-samsung/pm.c | 2 ++
> > 4 files changed, 25 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/arm/mach-s3c2410/include/mach/pm-core.h
> b/arch/arm/mach-
> > s3c2410/include/mach/pm-core.h
> > index 70a83b2..45eea52 100644
> > --- a/arch/arm/mach-s3c2410/include/mach/pm-core.h
> > +++ b/arch/arm/mach-s3c2410/include/mach/pm-core.h
> > @@ -62,3 +62,6 @@ static inline void s3c_pm_arch_update_uart(void __iomem
> > *regs,
> > struct pm_uart_save *save)
> > {
> > }
> > +
> > +static inline void s3c_pm_restored_gpios(void) { }
> > +static inline void s3c_pm_saved_gpios(void) { }
> > diff --git a/arch/arm/mach-s3c64xx/include/mach/pm-core.h
> b/arch/arm/mach-
> > s3c64xx/include/mach/pm-core.h
> > index 4ed0f58..38659be 100644
> > --- a/arch/arm/mach-s3c64xx/include/mach/pm-core.h
> > +++ b/arch/arm/mach-s3c64xx/include/mach/pm-core.h
> > @@ -96,3 +96,20 @@ static inline void s3c_pm_arch_update_uart(void
> __iomem
> > *regs,
> > 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);
> > +}
> > diff --git a/arch/arm/mach-s5pv210/include/mach/pm-core.h
> b/arch/arm/mach-
> > s5pv210/include/mach/pm-core.h
> > index e8d394f..3e22109 100644
> > --- a/arch/arm/mach-s5pv210/include/mach/pm-core.h
> > +++ b/arch/arm/mach-s5pv210/include/mach/pm-core.h
> > @@ -41,3 +41,6 @@ static inline void s3c_pm_arch_update_uart(void __iomem
> > *regs,
> > {
> > /* nothing here yet */
> > }
> > +
> > +static inline void s3c_pm_restored_gpios(void) { }
> > +static inline void s3c_pm_saved_gpios(void) { }
> > diff --git a/arch/arm/plat-samsung/pm.c b/arch/arm/plat-samsung/pm.c
> > index 5c0a440..4f9a951 100644
> > --- a/arch/arm/plat-samsung/pm.c
> > +++ b/arch/arm/plat-samsung/pm.c
> > @@ -268,6 +268,7 @@ static int s3c_pm_enter(suspend_state_t state)
> > /* save all necessary core registers not covered by the drivers */
> >
> > s3c_pm_save_gpios();
> > + s3c_pm_saved_gpios();
> > s3c_pm_save_uarts();
> > s3c_pm_save_core();
> >
> > @@ -309,6 +310,7 @@ static int s3c_pm_enter(suspend_state_t state)
> > s3c_pm_restore_core();
> > s3c_pm_restore_uarts();
> > s3c_pm_restore_gpios();
> > + s3c_pm_restored_gpios();
> >
> > s3c_pm_debug_init();
> >
> > --
> > 1.7.4.1
>
> Ok, will apply.
This patch lacks stubs for s5p64x0, s5pc100 and exynos4. I will send a quick fix
soon.
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ARM: SAMSUNG: Add support for pre-sleep/post-restore gpio control
2011-06-07 6:50 ` Marek Szyprowski
@ 2011-06-09 21:41 ` Kukjin Kim
2011-06-10 6:09 ` Marek Szyprowski
0 siblings, 1 reply; 5+ messages in thread
From: Kukjin Kim @ 2011-06-09 21:41 UTC (permalink / raw)
To: linux-arm-kernel
On 06/06/11 23:50, Marek Szyprowski wrote:
> Hello,
>
Hi :)
(snip)
>
> This patch lacks stubs for s5p64x0, s5pc100 and exynos4. I will send a quick fix
> soon.
Oops, I couldn't test it all on my laptop which is so slow :(
OK, thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ARM: SAMSUNG: Add support for pre-sleep/post-restore gpio control
2011-06-09 21:41 ` Kukjin Kim
@ 2011-06-10 6:09 ` Marek Szyprowski
0 siblings, 0 replies; 5+ messages in thread
From: Marek Szyprowski @ 2011-06-10 6:09 UTC (permalink / raw)
To: linux-arm-kernel
Hello,
On Thursday, June 09, 2011 11:41 PM Kukjin Kim wrote:
> On 06/06/11 23:50, Marek Szyprowski wrote:
> > Hello,
> >
> Hi :)
>
> (snip)
>
> >
> > This patch lacks stubs for s5p64x0, s5pc100 and exynos4. I will send a
> quick fix
> > soon.
>
> Oops, I couldn't test it all on my laptop which is so slow :(
In fact the problem was only on exynos4 platform, because both s5p64x0 and
s5pc100 don't support pm at all. I've posted build fix patch for exynos4.
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-06-10 6:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-27 17:34 [PATCH] ARM: SAMSUNG: Add support for pre-sleep/post-restore gpio control Mark Brown
2011-05-06 5:02 ` Kukjin Kim
2011-06-07 6:50 ` Marek Szyprowski
2011-06-09 21:41 ` Kukjin Kim
2011-06-10 6:09 ` Marek Szyprowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).