aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@rpsys.net>2005-11-06 10:03:23 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-11-06 10:03:23 -0500
commit756c7b748926b0baec6d2a921c3711679282c8fd (patch)
tree6eba4a4e31eef4e40c5bec85bc420006034e6cbe
parentb7ec479553b8755dd95ee988a957cbf2aef351dc (diff)
[ARM] 3113/1: PXA: Allow machines to override (and also reuse) pxa pm functions
Patch from Richard Purdie Update the PXA pm.c file to allow machines (such as the Sharp Zaurus) to override the standard pm functions but reuse/wrap them where needed. The init call is made slightly earlier to give machine code an init level to override them in removing any race. Signed-off-by: Richard Purdie Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/mach-pxa/pm.c16
-rw-r--r--include/asm-arm/arch-pxa/pm.h12
2 files changed, 24 insertions, 4 deletions
diff --git a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c
index ac4dd4336160..f74b9af112dc 100644
--- a/arch/arm/mach-pxa/pm.c
+++ b/arch/arm/mach-pxa/pm.c
@@ -12,6 +12,7 @@
12 */ 12 */
13#include <linux/config.h> 13#include <linux/config.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/module.h>
15#include <linux/suspend.h> 16#include <linux/suspend.h>
16#include <linux/errno.h> 17#include <linux/errno.h>
17#include <linux/time.h> 18#include <linux/time.h>
@@ -19,6 +20,7 @@
19#include <asm/hardware.h> 20#include <asm/hardware.h>
20#include <asm/memory.h> 21#include <asm/memory.h>
21#include <asm/system.h> 22#include <asm/system.h>
23#include <asm/arch/pm.h>
22#include <asm/arch/pxa-regs.h> 24#include <asm/arch/pxa-regs.h>
23#include <asm/arch/lubbock.h> 25#include <asm/arch/lubbock.h>
24#include <asm/mach/time.h> 26#include <asm/mach/time.h>
@@ -72,7 +74,7 @@ enum { SLEEP_SAVE_START = 0,
72}; 74};
73 75
74 76
75static int pxa_pm_enter(suspend_state_t state) 77int pxa_pm_enter(suspend_state_t state)
76{ 78{
77 unsigned long sleep_save[SLEEP_SAVE_SIZE]; 79 unsigned long sleep_save[SLEEP_SAVE_SIZE];
78 unsigned long checksum = 0; 80 unsigned long checksum = 0;
@@ -191,6 +193,8 @@ static int pxa_pm_enter(suspend_state_t state)
191 return 0; 193 return 0;
192} 194}
193 195
196EXPORT_SYMBOL_GPL(pxa_pm_enter);
197
194unsigned long sleep_phys_sp(void *sp) 198unsigned long sleep_phys_sp(void *sp)
195{ 199{
196 return virt_to_phys(sp); 200 return virt_to_phys(sp);
@@ -199,21 +203,25 @@ unsigned long sleep_phys_sp(void *sp)
199/* 203/*
200 * Called after processes are frozen, but before we shut down devices. 204 * Called after processes are frozen, but before we shut down devices.
201 */ 205 */
202static int pxa_pm_prepare(suspend_state_t state) 206int pxa_pm_prepare(suspend_state_t state)
203{ 207{
204 extern int pxa_cpu_pm_prepare(suspend_state_t state); 208 extern int pxa_cpu_pm_prepare(suspend_state_t state);
205 209
206 return pxa_cpu_pm_prepare(state); 210 return pxa_cpu_pm_prepare(state);
207} 211}
208 212
213EXPORT_SYMBOL_GPL(pxa_pm_prepare);
214
209/* 215/*
210 * Called after devices are re-setup, but before processes are thawed. 216 * Called after devices are re-setup, but before processes are thawed.
211 */ 217 */
212static int pxa_pm_finish(suspend_state_t state) 218int pxa_pm_finish(suspend_state_t state)
213{ 219{
214 return 0; 220 return 0;
215} 221}
216 222
223EXPORT_SYMBOL_GPL(pxa_pm_finish);
224
217/* 225/*
218 * Set to PM_DISK_FIRMWARE so we can quickly veto suspend-to-disk. 226 * Set to PM_DISK_FIRMWARE so we can quickly veto suspend-to-disk.
219 */ 227 */
@@ -230,4 +238,4 @@ static int __init pxa_pm_init(void)
230 return 0; 238 return 0;
231} 239}
232 240
233late_initcall(pxa_pm_init); 241device_initcall(pxa_pm_init);
diff --git a/include/asm-arm/arch-pxa/pm.h b/include/asm-arm/arch-pxa/pm.h
new file mode 100644
index 000000000000..7a8a1cdf430d
--- /dev/null
+++ b/include/asm-arm/arch-pxa/pm.h
@@ -0,0 +1,12 @@
1/*
2 * Copyright (c) 2005 Richard Purdie
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 */
9
10extern int pxa_pm_prepare(suspend_state_t state);
11extern int pxa_pm_enter(suspend_state_t state);
12extern int pxa_pm_finish(suspend_state_t state);