diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2007-05-15 06:16:10 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-07-12 09:28:05 -0400 |
commit | e176bb05fec4c00450302a75e81f8da3dc9e309e (patch) | |
tree | 85b04f821ceb53f1aaf7289cecc6af0370912559 /arch | |
parent | b23170c01f6e4ea043df7cd9486c2488e01f3d60 (diff) |
[ARM] pxa: move pm_ops structure into CPU specific files
Move the pm_ops structure into the PXA25x and PXA27x support
files. Remove the old pxa_pm_prepare() function, and rename
the both pxa_cpu_pm_prepare() functions as pxa_pm_prepare().
We'll fix that later.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-pxa/pm.c | 26 | ||||
-rw-r--r-- | arch/arm/mach-pxa/pxa25x.c | 20 | ||||
-rw-r--r-- | arch/arm/mach-pxa/pxa27x.c | 17 |
3 files changed, 34 insertions, 29 deletions
diff --git a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c index 6d86203aef7..d439ffa1b07 100644 --- a/arch/arm/mach-pxa/pm.c +++ b/arch/arm/mach-pxa/pm.c | |||
@@ -200,29 +200,3 @@ unsigned long sleep_phys_sp(void *sp) | |||
200 | { | 200 | { |
201 | return virt_to_phys(sp); | 201 | return virt_to_phys(sp); |
202 | } | 202 | } |
203 | |||
204 | /* | ||
205 | * Called after processes are frozen, but before we shut down devices. | ||
206 | */ | ||
207 | int pxa_pm_prepare(suspend_state_t state) | ||
208 | { | ||
209 | extern int pxa_cpu_pm_prepare(suspend_state_t state); | ||
210 | |||
211 | return pxa_cpu_pm_prepare(state); | ||
212 | } | ||
213 | |||
214 | EXPORT_SYMBOL_GPL(pxa_pm_prepare); | ||
215 | |||
216 | static struct pm_ops pxa_pm_ops = { | ||
217 | .prepare = pxa_pm_prepare, | ||
218 | .enter = pxa_pm_enter, | ||
219 | .valid = pm_valid_only_mem, | ||
220 | }; | ||
221 | |||
222 | static int __init pxa_pm_init(void) | ||
223 | { | ||
224 | pm_set_ops(&pxa_pm_ops); | ||
225 | return 0; | ||
226 | } | ||
227 | |||
228 | device_initcall(pxa_pm_init); | ||
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c index c1f21739bf7..8560439ba0b 100644 --- a/arch/arm/mach-pxa/pxa25x.c +++ b/arch/arm/mach-pxa/pxa25x.c | |||
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | #include <asm/hardware.h> | 24 | #include <asm/hardware.h> |
25 | #include <asm/arch/pxa-regs.h> | 25 | #include <asm/arch/pxa-regs.h> |
26 | #include <asm/arch/pm.h> | ||
26 | 27 | ||
27 | #include "generic.h" | 28 | #include "generic.h" |
28 | 29 | ||
@@ -105,7 +106,7 @@ EXPORT_SYMBOL(get_lcdclk_frequency_10khz); | |||
105 | 106 | ||
106 | #ifdef CONFIG_PM | 107 | #ifdef CONFIG_PM |
107 | 108 | ||
108 | int pxa_cpu_pm_prepare(suspend_state_t state) | 109 | int pxa_pm_prepare(suspend_state_t state) |
109 | { | 110 | { |
110 | switch (state) { | 111 | switch (state) { |
111 | case PM_SUSPEND_MEM: | 112 | case PM_SUSPEND_MEM: |
@@ -133,4 +134,21 @@ void pxa_cpu_pm_enter(suspend_state_t state) | |||
133 | } | 134 | } |
134 | } | 135 | } |
135 | 136 | ||
137 | static struct pm_ops pxa25x_pm_ops = { | ||
138 | .prepare = pxa_pm_prepare, | ||
139 | .enter = pxa_pm_enter, | ||
140 | .valid = pm_valid_only_mem, | ||
141 | }; | ||
136 | #endif | 142 | #endif |
143 | |||
144 | static int __init pxa25x_init(void) | ||
145 | { | ||
146 | if (cpu_is_pxa21x() || cpu_is_pxa25x()) { | ||
147 | #ifdef CONFIG_PM | ||
148 | pm_set_ops(&pxa25x_pm_ops); | ||
149 | #endif | ||
150 | } | ||
151 | return 0; | ||
152 | } | ||
153 | |||
154 | subsys_initcall(pxa25x_init); | ||
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index 1939acc3f9f..be6ca7d3afa 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <asm/irq.h> | 21 | #include <asm/irq.h> |
22 | #include <asm/arch/pxa-regs.h> | 22 | #include <asm/arch/pxa-regs.h> |
23 | #include <asm/arch/ohci.h> | 23 | #include <asm/arch/ohci.h> |
24 | #include <asm/arch/pm.h> | ||
24 | 25 | ||
25 | #include "generic.h" | 26 | #include "generic.h" |
26 | 27 | ||
@@ -122,7 +123,7 @@ EXPORT_SYMBOL(get_lcdclk_frequency_10khz); | |||
122 | 123 | ||
123 | #ifdef CONFIG_PM | 124 | #ifdef CONFIG_PM |
124 | 125 | ||
125 | int pxa_cpu_pm_prepare(suspend_state_t state) | 126 | int pxa_pm_prepare(suspend_state_t state) |
126 | { | 127 | { |
127 | switch (state) { | 128 | switch (state) { |
128 | case PM_SUSPEND_MEM: | 129 | case PM_SUSPEND_MEM: |
@@ -162,6 +163,11 @@ void pxa_cpu_pm_enter(suspend_state_t state) | |||
162 | } | 163 | } |
163 | } | 164 | } |
164 | 165 | ||
166 | static struct pm_ops pxa27x_pm_ops = { | ||
167 | .prepare = pxa_pm_prepare, | ||
168 | .enter = pxa_pm_enter, | ||
169 | .valid = pm_valid_only_mem, | ||
170 | }; | ||
165 | #endif | 171 | #endif |
166 | 172 | ||
167 | /* | 173 | /* |
@@ -205,7 +211,14 @@ static struct platform_device *devices[] __initdata = { | |||
205 | 211 | ||
206 | static int __init pxa27x_init(void) | 212 | static int __init pxa27x_init(void) |
207 | { | 213 | { |
208 | return platform_add_devices(devices, ARRAY_SIZE(devices)); | 214 | int ret = 0; |
215 | if (cpu_is_pxa27x()) { | ||
216 | #ifdef CONFIG_PM | ||
217 | pm_set_ops(&pxa27x_pm_ops); | ||
218 | #endif | ||
219 | ret = platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
220 | } | ||
221 | return ret; | ||
209 | } | 222 | } |
210 | 223 | ||
211 | subsys_initcall(pxa27x_init); | 224 | subsys_initcall(pxa27x_init); |