diff mbox

[7/7] ARM: EXYNOS4: Move S5P_CENTRAL_SEQ_CONFIGURATION setting for PM

Message ID 1308732405-16664-8-git-send-email-kgene.kim@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kim Kukjin June 22, 2011, 8:46 a.m. UTC
From: Jaecheol Lee <jc.lee@samsung.com>

We need to balance between set and check S5P_CENTRAL_SEQ_CONFIGURATION
register in syscore_ops suspend/resume function when failure in enter
suspend mode. Moved this register setting for PM for the purpose of balancing.

Signed-off-by: Jaecheol Lee <jc.lee@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
 arch/arm/mach-exynos4/pm.c |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

Comments

Sergei Shtylyov June 22, 2011, 12:10 p.m. UTC | #1
Hello.

On 22-06-2011 12:46, Kukjin Kim wrote:

> From: Jaecheol Lee<jc.lee@samsung.com>

> We need to balance between set and check S5P_CENTRAL_SEQ_CONFIGURATION
> register in syscore_ops suspend/resume function when failure in enter
> suspend mode. Moved this register setting for PM for the purpose of balancing.

> Signed-off-by: Jaecheol Lee<jc.lee@samsung.com>
> Signed-off-by: Kukjin Kim<kgene.kim@samsung.com>
> ---
>   arch/arm/mach-exynos4/pm.c |   22 ++++++++++++++--------
>   1 files changed, 14 insertions(+), 8 deletions(-)

> diff --git a/arch/arm/mach-exynos4/pm.c b/arch/arm/mach-exynos4/pm.c
> index b037fba..a103c13 100644
> --- a/arch/arm/mach-exynos4/pm.c
> +++ b/arch/arm/mach-exynos4/pm.c
[...]
> @@ -413,6 +405,19 @@ static __init int exynos4_pm_drvinit(void)
>   }
>   arch_initcall(exynos4_pm_drvinit);
>
> +static int exynos4_pm_suspend(void)
> +{
> +	unsigned long tmp;
> +
> +	/* Setting Central Sequence Register for power down mode */
> +
> +	tmp = __raw_readl(S5P_CENTRAL_SEQ_CONFIGURATION);
> +	tmp &= ~(S5P_CENTRAL_LOWPWR_CFG);

    Could drop useless parens, while at it.

WBR, Sergei
Kim Kukjin June 23, 2011, 8:05 a.m. UTC | #2
Sergei Shtylyov wrote:
> 
> Hello.
> 
Hi :)

> On 22-06-2011 12:46, Kukjin Kim wrote:
> 
> > From: Jaecheol Lee<jc.lee@samsung.com>
> 
> > We need to balance between set and check
> S5P_CENTRAL_SEQ_CONFIGURATION
> > register in syscore_ops suspend/resume function when failure in enter
> > suspend mode. Moved this register setting for PM for the purpose of
balancing.
> 
> > Signed-off-by: Jaecheol Lee<jc.lee@samsung.com>
> > Signed-off-by: Kukjin Kim<kgene.kim@samsung.com>
> > ---
> >   arch/arm/mach-exynos4/pm.c |   22 ++++++++++++++--------
> >   1 files changed, 14 insertions(+), 8 deletions(-)
> 
> > diff --git a/arch/arm/mach-exynos4/pm.c b/arch/arm/mach-exynos4/pm.c
> > index b037fba..a103c13 100644
> > --- a/arch/arm/mach-exynos4/pm.c
> > +++ b/arch/arm/mach-exynos4/pm.c
> [...]
> > @@ -413,6 +405,19 @@ static __init int exynos4_pm_drvinit(void)
> >   }
> >   arch_initcall(exynos4_pm_drvinit);
> >
> > +static int exynos4_pm_suspend(void)
> > +{
> > +	unsigned long tmp;
> > +
> > +	/* Setting Central Sequence Register for power down mode */
> > +
> > +	tmp = __raw_readl(S5P_CENTRAL_SEQ_CONFIGURATION);
> > +	tmp &= ~(S5P_CENTRAL_LOWPWR_CFG);
> 
>     Could drop useless parens, while at it.
> 
Sergei, thanks ;)

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
diff mbox

Patch

diff --git a/arch/arm/mach-exynos4/pm.c b/arch/arm/mach-exynos4/pm.c
index b037fba..a103c13 100644
--- a/arch/arm/mach-exynos4/pm.c
+++ b/arch/arm/mach-exynos4/pm.c
@@ -249,14 +249,6 @@  static struct sleep_save exynos4_l2cc_save[] = {
 
 void exynos4_cpu_suspend(void)
 {
-	unsigned long tmp;
-
-	/* Setting Central Sequence Register for power down mode */
-
-	tmp = __raw_readl(S5P_CENTRAL_SEQ_CONFIGURATION);
-	tmp &= ~(S5P_CENTRAL_LOWPWR_CFG);
-	__raw_writel(tmp, S5P_CENTRAL_SEQ_CONFIGURATION);
-
 	outer_flush_all();
 
 	/* issue the standby signal into the pm unit. */
@@ -413,6 +405,19 @@  static __init int exynos4_pm_drvinit(void)
 }
 arch_initcall(exynos4_pm_drvinit);
 
+static int exynos4_pm_suspend(void)
+{
+	unsigned long tmp;
+
+	/* Setting Central Sequence Register for power down mode */
+
+	tmp = __raw_readl(S5P_CENTRAL_SEQ_CONFIGURATION);
+	tmp &= ~(S5P_CENTRAL_LOWPWR_CFG);
+	__raw_writel(tmp, S5P_CENTRAL_SEQ_CONFIGURATION);
+
+	return 0;
+}
+
 static void exynos4_pm_resume(void)
 {
 	unsigned long tmp;
@@ -459,6 +464,7 @@  early_wakeup:
 }
 
 static struct syscore_ops exynos4_pm_syscore_ops = {
+	.suspend	= exynos4_pm_suspend,
 	.resume		= exynos4_pm_resume,
 };