aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/pxa27x.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-08-27 07:55:04 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-09-09 11:32:52 -0400
commit4104980a3c21801f701e53961375b3d736ee9a73 (patch)
treef2c0b6759e45fd696a138a4ff32caabc513f32af /arch/arm/mach-pxa/pxa27x.c
parent63bef5473892ae683a9e989975180a5754b0ae33 (diff)
[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.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index c33cf6ac8c81..4835207c1426 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)
220 220
221void pxa27x_cpu_pm_restore(unsigned long *sleep_save) 221void pxa27x_cpu_pm_restore(unsigned long *sleep_save)
222{ 222{
223 /* ensure not to come back here if it wasn't intended */
224 PSPR = 0;
225
226 /* restore registers */ 223 /* restore registers */
227 RESTORE(GAFR0_L); RESTORE(GAFR0_U); 224 RESTORE(GAFR0_L); RESTORE(GAFR0_U);
228 RESTORE(GAFR1_L); RESTORE(GAFR1_U); 225 RESTORE(GAFR1_L); RESTORE(GAFR1_U);
@@ -259,8 +256,6 @@ void pxa27x_cpu_pm_enter(suspend_state_t state)
259 pxa_cpu_standby(); 256 pxa_cpu_standby();
260 break; 257 break;
261 case PM_SUSPEND_MEM: 258 case PM_SUSPEND_MEM:
262 /* set resume return address */
263 PSPR = virt_to_phys(pxa_cpu_resume);
264 pxa27x_cpu_suspend(PWRMODE_SLEEP); 259 pxa27x_cpu_suspend(PWRMODE_SLEEP);
265 break; 260 break;
266 } 261 }
@@ -271,12 +266,27 @@ static int pxa27x_cpu_pm_valid(suspend_state_t state)
271 return state == PM_SUSPEND_MEM || state == PM_SUSPEND_STANDBY; 266 return state == PM_SUSPEND_MEM || state == PM_SUSPEND_STANDBY;
272} 267}
273 268
269static int pxa27x_cpu_pm_prepare(void)
270{
271 /* set resume return address */
272 PSPR = virt_to_phys(pxa_cpu_resume);
273 return 0;
274}
275
276static void pxa27x_cpu_pm_finish(void)
277{
278 /* ensure not to come back here if it wasn't intended */
279 PSPR = 0;
280}
281
274static struct pxa_cpu_pm_fns pxa27x_cpu_pm_fns = { 282static struct pxa_cpu_pm_fns pxa27x_cpu_pm_fns = {
275 .save_count = SLEEP_SAVE_COUNT, 283 .save_count = SLEEP_SAVE_COUNT,
276 .save = pxa27x_cpu_pm_save, 284 .save = pxa27x_cpu_pm_save,
277 .restore = pxa27x_cpu_pm_restore, 285 .restore = pxa27x_cpu_pm_restore,
278 .valid = pxa27x_cpu_pm_valid, 286 .valid = pxa27x_cpu_pm_valid,
279 .enter = pxa27x_cpu_pm_enter, 287 .enter = pxa27x_cpu_pm_enter,
288 .prepare = pxa27x_cpu_pm_prepare,
289 .finish = pxa27x_cpu_pm_finish,
280}; 290};
281 291
282static void __init pxa27x_init_pm(void) 292static void __init pxa27x_init_pm(void)