diff options
author | Mike Rapoport <mike@compulab.co.il> | 2009-05-26 09:10:18 +0300 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2009-06-05 10:32:48 +0800 |
commit | d082d36ea82aff6f25e8380770713e6fd0c7290a (patch) | |
tree | 7e91b06429cead8907da244ecb71aae7cdea05bb /arch/arm/mach-pxa/pxa27x.c | |
parent | 94c35a6b5129bc370893d74085c13607f260ef39 (diff) | |
download | kernel_samsung_smdk4412-d082d36ea82aff6f25e8380770713e6fd0c7290a.zip kernel_samsung_smdk4412-d082d36ea82aff6f25e8380770713e6fd0c7290a.tar.gz kernel_samsung_smdk4412-d082d36ea82aff6f25e8380770713e6fd0c7290a.tar.bz2 |
[ARM] pxa: add ability to set suspend mode
PXA processors have several low-power modes. Currently kernel supports
only one of these modes for PM_SUSPEND_MEM.
This patch adds ability to set desired suspend mode for PXA27x based
machines.
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Reviewed-by: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Diffstat (limited to 'arch/arm/mach-pxa/pxa27x.c')
-rw-r--r-- | arch/arm/mach-pxa/pxa27x.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index c54ad8b..ec68cc1 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c @@ -204,6 +204,23 @@ static struct clk_lookup pxa27x_clkregs[] = { #define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x] /* + * allow platforms to override default PWRMODE setting used for PM_SUSPEND_MEM + */ +static unsigned int pwrmode = PWRMODE_SLEEP; + +int __init pxa27x_set_pwrmode(unsigned int mode) +{ + switch (mode) { + case PWRMODE_SLEEP: + case PWRMODE_DEEPSLEEP: + pwrmode = mode; + return 0; + } + + return -EINVAL; +} + +/* * List of global PXA peripheral registers to preserve. * More ones like CP and general purpose register values are preserved * with the stack pointer in sleep.S. @@ -254,7 +271,7 @@ void pxa27x_cpu_pm_enter(suspend_state_t state) pxa_cpu_standby(); break; case PM_SUSPEND_MEM: - pxa27x_cpu_suspend(PWRMODE_SLEEP); + pxa27x_cpu_suspend(pwrmode); break; } } |