diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-08-27 07:55:04 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-09-09 11:32:52 -0400 |
commit | 4104980a3c21801f701e53961375b3d736ee9a73 (patch) | |
tree | f2c0b6759e45fd696a138a4ff32caabc513f32af /arch/arm/mach-pxa/pxa25x.c | |
parent | 63bef5473892ae683a9e989975180a5754b0ae33 (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/pxa25x.c')
-rw-r--r-- | arch/arm/mach-pxa/pxa25x.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c index 305452b56e91..db7be22ccd17 100644 --- a/arch/arm/mach-pxa/pxa25x.c +++ b/arch/arm/mach-pxa/pxa25x.c | |||
@@ -234,9 +234,6 @@ static void pxa25x_cpu_pm_save(unsigned long *sleep_save) | |||
234 | 234 | ||
235 | static void pxa25x_cpu_pm_restore(unsigned long *sleep_save) | 235 | static void pxa25x_cpu_pm_restore(unsigned long *sleep_save) |
236 | { | 236 | { |
237 | /* ensure not to come back here if it wasn't intended */ | ||
238 | PSPR = 0; | ||
239 | |||
240 | /* restore registers */ | 237 | /* restore registers */ |
241 | RESTORE(GAFR0_L); RESTORE(GAFR0_U); | 238 | RESTORE(GAFR0_L); RESTORE(GAFR0_U); |
242 | RESTORE(GAFR1_L); RESTORE(GAFR1_U); | 239 | RESTORE(GAFR1_L); RESTORE(GAFR1_U); |
@@ -256,19 +253,32 @@ static void pxa25x_cpu_pm_enter(suspend_state_t state) | |||
256 | 253 | ||
257 | switch (state) { | 254 | switch (state) { |
258 | case PM_SUSPEND_MEM: | 255 | case PM_SUSPEND_MEM: |
259 | /* set resume return address */ | ||
260 | PSPR = virt_to_phys(pxa_cpu_resume); | ||
261 | pxa25x_cpu_suspend(PWRMODE_SLEEP); | 256 | pxa25x_cpu_suspend(PWRMODE_SLEEP); |
262 | break; | 257 | break; |
263 | } | 258 | } |
264 | } | 259 | } |
265 | 260 | ||
261 | static int pxa25x_cpu_pm_prepare(void) | ||
262 | { | ||
263 | /* set resume return address */ | ||
264 | PSPR = virt_to_phys(pxa_cpu_resume); | ||
265 | return 0; | ||
266 | } | ||
267 | |||
268 | static void pxa25x_cpu_pm_finish(void) | ||
269 | { | ||
270 | /* ensure not to come back here if it wasn't intended */ | ||
271 | PSPR = 0; | ||
272 | } | ||
273 | |||
266 | static struct pxa_cpu_pm_fns pxa25x_cpu_pm_fns = { | 274 | static struct pxa_cpu_pm_fns pxa25x_cpu_pm_fns = { |
267 | .save_count = SLEEP_SAVE_COUNT, | 275 | .save_count = SLEEP_SAVE_COUNT, |
268 | .valid = suspend_valid_only_mem, | 276 | .valid = suspend_valid_only_mem, |
269 | .save = pxa25x_cpu_pm_save, | 277 | .save = pxa25x_cpu_pm_save, |
270 | .restore = pxa25x_cpu_pm_restore, | 278 | .restore = pxa25x_cpu_pm_restore, |
271 | .enter = pxa25x_cpu_pm_enter, | 279 | .enter = pxa25x_cpu_pm_enter, |
280 | .prepare = pxa25x_cpu_pm_prepare, | ||
281 | .finish = pxa25x_cpu_pm_finish, | ||
272 | }; | 282 | }; |
273 | 283 | ||
274 | static void __init pxa25x_init_pm(void) | 284 | static void __init pxa25x_init_pm(void) |