diff options
author | Mike Rapoport <mike@compulab.co.il> | 2009-05-26 02:10:18 -0400 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2009-06-04 22:32:48 -0400 |
commit | d082d36ea82aff6f25e8380770713e6fd0c7290a (patch) | |
tree | 7e91b06429cead8907da244ecb71aae7cdea05bb | |
parent | 94c35a6b5129bc370893d74085c13607f260ef39 (diff) |
[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>
-rw-r--r-- | arch/arm/mach-pxa/include/mach/pxa27x.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-pxa/pxa27x.c | 19 |
2 files changed, 21 insertions, 1 deletions
diff --git a/arch/arm/mach-pxa/include/mach/pxa27x.h b/arch/arm/mach-pxa/include/mach/pxa27x.h index 6876e16c2970..0b702693f458 100644 --- a/arch/arm/mach-pxa/include/mach/pxa27x.h +++ b/arch/arm/mach-pxa/include/mach/pxa27x.h | |||
@@ -16,4 +16,7 @@ | |||
16 | #define ARB_DMA_PARK (1<<25) /* Be parked with DMA when idle */ | 16 | #define ARB_DMA_PARK (1<<25) /* Be parked with DMA when idle */ |
17 | #define ARB_CORE_PARK (1<<24) /* Be parked with core when idle */ | 17 | #define ARB_CORE_PARK (1<<24) /* Be parked with core when idle */ |
18 | #define ARB_LOCK_FLAG (1<<23) /* Only Locking masters gain access to the bus */ | 18 | #define ARB_LOCK_FLAG (1<<23) /* Only Locking masters gain access to the bus */ |
19 | |||
20 | extern int __init pxa27x_set_pwrmode(unsigned int mode); | ||
21 | |||
19 | #endif /* __MACH_PXA27x_H */ | 22 | #endif /* __MACH_PXA27x_H */ |
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index c54ad8b3343c..ec68cc16b4e3 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[] = { | |||
204 | #define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x] | 204 | #define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x] |
205 | 205 | ||
206 | /* | 206 | /* |
207 | * allow platforms to override default PWRMODE setting used for PM_SUSPEND_MEM | ||
208 | */ | ||
209 | static unsigned int pwrmode = PWRMODE_SLEEP; | ||
210 | |||
211 | int __init pxa27x_set_pwrmode(unsigned int mode) | ||
212 | { | ||
213 | switch (mode) { | ||
214 | case PWRMODE_SLEEP: | ||
215 | case PWRMODE_DEEPSLEEP: | ||
216 | pwrmode = mode; | ||
217 | return 0; | ||
218 | } | ||
219 | |||
220 | return -EINVAL; | ||
221 | } | ||
222 | |||
223 | /* | ||
207 | * List of global PXA peripheral registers to preserve. | 224 | * List of global PXA peripheral registers to preserve. |
208 | * More ones like CP and general purpose register values are preserved | 225 | * More ones like CP and general purpose register values are preserved |
209 | * with the stack pointer in sleep.S. | 226 | * with the stack pointer in sleep.S. |
@@ -254,7 +271,7 @@ void pxa27x_cpu_pm_enter(suspend_state_t state) | |||
254 | pxa_cpu_standby(); | 271 | pxa_cpu_standby(); |
255 | break; | 272 | break; |
256 | case PM_SUSPEND_MEM: | 273 | case PM_SUSPEND_MEM: |
257 | pxa27x_cpu_suspend(PWRMODE_SLEEP); | 274 | pxa27x_cpu_suspend(pwrmode); |
258 | break; | 275 | break; |
259 | } | 276 | } |
260 | } | 277 | } |