aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-pxa/include/mach/pxa27x.h3
-rw-r--r--arch/arm/mach-pxa/pxa27x.c19
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
20extern 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 */
209static unsigned int pwrmode = PWRMODE_SLEEP;
210
211int __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}