Patchwork [08/26] ARM: pxa: move z2 to generic cpu_suspend

login
register
mail settings
Submitter Eric Miao
Date Oct. 8, 2011, 12:37 p.m.
Message ID <CAMPhdO97bJZ1FRHUq_VHQ8oHyY7U4ay-jv5Ft+gunRwtBvz8qw@mail.gmail.com>
Download mbox | patch
Permalink /patch/118529/
State New
Headers show

Comments

Eric Miao - Oct. 8, 2011, 12:37 p.m.
On Fri, Oct 7, 2011 at 5:56 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Friday 07 October 2011, Eric Miao wrote:
>> commit 3f7961cbd3428c8639d42d1a51870466e4cbb0eb
>> Author: Eric Miao <eric.y.miao@gmail.com>
>> Date:   Sun Sep 11 17:19:11 2011 +0800
>>
>>     ARM: pxa/z2: fix building error of pxa27x_cpu_suspend() no longer available
>>
>>     Cc: Vasily Khoruzhick <anarsoul@gmail.com>
>>     Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
>>
>> diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c
>> index 6c9275a..6fa4e74 100644
>> --- a/arch/arm/mach-pxa/z2.c
>> +++ b/arch/arm/mach-pxa/z2.c
>> @@ -679,6 +679,8 @@ static inline void z2_pmic_init(void) {}
>>  #endif
>>
>>  #ifdef CONFIG_PM
>> +extern void pxa27x_cpu_pm_enter(suspend_state_t state);
>> +
>>  static void z2_power_off(void)
>>  {
>>         /* We're using deep sleep as poweroff, so clear PSPR to ensure that
>
> You really shouldn't have an extern declaration in a .c file. Otherwise
> looks good to me.

How about this one?
Arnd Bergmann - Oct. 8, 2011, 1 p.m.
On Saturday 08 October 2011 20:37:53 Eric Miao wrote:
> >>
> >>  #ifdef CONFIG_PM
> >> +extern void pxa27x_cpu_pm_enter(suspend_state_t state);
> >> +
> >>  static void z2_power_off(void)
> >>  {
> >>         /* We're using deep sleep as poweroff, so clear PSPR to ensure that
> >
> > You really shouldn't have an extern declaration in a .c file. Otherwise
> > looks good to me.
> 
> How about this one?

Yes, looks good as far as I can tell (I still don't quite understand how the
cpu power management all fits together, but I don't see anything wrong with
it either.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Eric Miao - Oct. 8, 2011, 1:02 p.m.
On Sat, Oct 8, 2011 at 9:00 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Saturday 08 October 2011 20:37:53 Eric Miao wrote:
>> >>
>> >>  #ifdef CONFIG_PM
>> >> +extern void pxa27x_cpu_pm_enter(suspend_state_t state);
>> >> +
>> >>  static void z2_power_off(void)
>> >>  {
>> >>         /* We're using deep sleep as poweroff, so clear PSPR to ensure that
>> >
>> > You really shouldn't have an extern declaration in a .c file. Otherwise
>> > looks good to me.
>>
>> How about this one?
>
> Yes, looks good as far as I can tell (I still don't quite understand how the
> cpu power management all fits together, but I don't see anything wrong with
> it either.
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>

Applied, thanks.

Patch

diff --git a/arch/arm/mach-pxa/include/mach/pxa27x.h
b/arch/arm/mach-pxa/include/mach/pxa27x.h
index b9b1bdc..7cff640 100644
--- a/arch/arm/mach-pxa/include/mach/pxa27x.h
+++ b/arch/arm/mach-pxa/include/mach/pxa27x.h
@@ -1,6 +1,7 @@ 
 #ifndef __MACH_PXA27x_H
 #define __MACH_PXA27x_H

+#include <linux/suspend.h>
 #include <mach/hardware.h>
 #include <mach/pxa2xx-regs.h>
 #include <mach/mfp-pxa27x.h>
@@ -21,6 +22,7 @@ 
 extern void __init pxa27x_map_io(void);
 extern void __init pxa27x_init_irq(void);
 extern int __init pxa27x_set_pwrmode(unsigned int mode);
+extern void pxa27x_cpu_pm_enter(suspend_state_t state);

 #define pxa27x_handle_irq      ichp_handle_irq

diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c
index 6c9275a..a82d420 100644
--- a/arch/arm/mach-pxa/z2.c
+++ b/arch/arm/mach-pxa/z2.c
@@ -686,7 +686,8 @@  static void z2_power_off(void)
         */
        PSPR = 0x0;
        local_irq_disable();
-       pxa27x_cpu_suspend(PWRMODE_DEEPSLEEP, PLAT_PHYS_OFFSET - PAGE_OFFSET);
+       pxa27x_set_pwrmode(PWRMODE_DEEPSLEEP);
+       pxa27x_cpu_pm_enter(PM_SUSPEND_MEM);
 }
 #else
 #define z2_power_off   NULL