diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-08-27 12:55:04 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-09-09 16:32:52 +0100 |
commit | 4104980a3c21801f701e53961375b3d736ee9a73 (patch) | |
tree | f2c0b6759e45fd696a138a4ff32caabc513f32af /arch/arm/mach-pxa/pxa27x.c | |
parent | 63bef5473892ae683a9e989975180a5754b0ae33 (diff) | |
download | kernel_samsung_smdk4412-4104980a3c21801f701e53961375b3d736ee9a73.zip kernel_samsung_smdk4412-4104980a3c21801f701e53961375b3d736ee9a73.tar.gz kernel_samsung_smdk4412-4104980a3c21801f701e53961375b3d736ee9a73.tar.bz2 |
[ARM] pxa: Allow platforms to override PSPR setting
Currently, we set PSPR just before entering sleep mode. However,
some platforms have different requirements for setting PSPR in
order to properly wake up.
Set PSPR earlier in the suspend cycle so that platforms can
change the setting by using a sysdev driver instead.
Acked-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-pxa/pxa27x.c')
-rw-r--r-- | arch/arm/mach-pxa/pxa27x.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index c33cf6a..4835207 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c @@ -220,9 +220,6 @@ void pxa27x_cpu_pm_save(unsigned long *sleep_save) void pxa27x_cpu_pm_restore(unsigned long *sleep_save) { - /* ensure not to come back here if it wasn't intended */ - PSPR = 0; - /* restore registers */ RESTORE(GAFR0_L); RESTORE(GAFR0_U); RESTORE(GAFR1_L); RESTORE(GAFR1_U); @@ -259,8 +256,6 @@ void pxa27x_cpu_pm_enter(suspend_state_t state) pxa_cpu_standby(); break; case PM_SUSPEND_MEM: - /* set resume return address */ - PSPR = virt_to_phys(pxa_cpu_resume); pxa27x_cpu_suspend(PWRMODE_SLEEP); break; } @@ -271,12 +266,27 @@ static int pxa27x_cpu_pm_valid(suspend_state_t state) return state == PM_SUSPEND_MEM || state == PM_SUSPEND_STANDBY; } +static int pxa27x_cpu_pm_prepare(void) +{ + /* set resume return address */ + PSPR = virt_to_phys(pxa_cpu_resume); + return 0; +} + +static void pxa27x_cpu_pm_finish(void) +{ + /* ensure not to come back here if it wasn't intended */ + PSPR = 0; +} + static struct pxa_cpu_pm_fns pxa27x_cpu_pm_fns = { .save_count = SLEEP_SAVE_COUNT, .save = pxa27x_cpu_pm_save, .restore = pxa27x_cpu_pm_restore, .valid = pxa27x_cpu_pm_valid, .enter = pxa27x_cpu_pm_enter, + .prepare = pxa27x_cpu_pm_prepare, + .finish = pxa27x_cpu_pm_finish, }; static void __init pxa27x_init_pm(void) |