aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/clock-pxa3xx.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2011-04-22 16:03:11 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2011-04-24 13:16:09 -0400
commit2eaa03b5bebd1e80014f780d7bf27c3e66daefd6 (patch)
tree9366c07d166eaede876cd7233cc30056f198a93f /arch/arm/mach-pxa/clock-pxa3xx.c
parent905339807bde7bb726001b69fbdf69ab0cf69a9e (diff)
ARM / PXA: Use struct syscore_ops for "core" power management
Replace sysdev classes and struct sys_device objects used for "core" power management by the PXA platform code with struct syscore_ops objects that are simpler. This reduces the code size and the kernel memory footprint. It also is necessary for removing sysdevs entirely from the kernel in the future. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/arm/mach-pxa/clock-pxa3xx.c')
-rw-r--r--arch/arm/mach-pxa/clock-pxa3xx.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/arch/arm/mach-pxa/clock-pxa3xx.c b/arch/arm/mach-pxa/clock-pxa3xx.c
index 3f864cd0bd28..2a37a9a8f621 100644
--- a/arch/arm/mach-pxa/clock-pxa3xx.c
+++ b/arch/arm/mach-pxa/clock-pxa3xx.c
@@ -10,6 +10,7 @@
10#include <linux/kernel.h> 10#include <linux/kernel.h>
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/io.h> 12#include <linux/io.h>
13#include <linux/syscore_ops.h>
13 14
14#include <mach/smemc.h> 15#include <mach/smemc.h>
15#include <mach/pxa3xx-regs.h> 16#include <mach/pxa3xx-regs.h>
@@ -182,7 +183,7 @@ const struct clkops clk_pxa3xx_pout_ops = {
182static uint32_t cken[2]; 183static uint32_t cken[2];
183static uint32_t accr; 184static uint32_t accr;
184 185
185static int pxa3xx_clock_suspend(struct sys_device *d, pm_message_t state) 186static int pxa3xx_clock_suspend(void)
186{ 187{
187 cken[0] = CKENA; 188 cken[0] = CKENA;
188 cken[1] = CKENB; 189 cken[1] = CKENB;
@@ -190,28 +191,18 @@ static int pxa3xx_clock_suspend(struct sys_device *d, pm_message_t state)
190 return 0; 191 return 0;
191} 192}
192 193
193static int pxa3xx_clock_resume(struct sys_device *d) 194static void pxa3xx_clock_resume(void)
194{ 195{
195 ACCR = accr; 196 ACCR = accr;
196 CKENA = cken[0]; 197 CKENA = cken[0];
197 CKENB = cken[1]; 198 CKENB = cken[1];
198 return 0;
199} 199}
200#else 200#else
201#define pxa3xx_clock_suspend NULL 201#define pxa3xx_clock_suspend NULL
202#define pxa3xx_clock_resume NULL 202#define pxa3xx_clock_resume NULL
203#endif 203#endif
204 204
205struct sysdev_class pxa3xx_clock_sysclass = { 205struct syscore_ops pxa3xx_clock_syscore_ops = {
206 .name = "pxa3xx-clock",
207 .suspend = pxa3xx_clock_suspend, 206 .suspend = pxa3xx_clock_suspend,
208 .resume = pxa3xx_clock_resume, 207 .resume = pxa3xx_clock_resume,
209}; 208};
210
211static int __init pxa3xx_clock_init(void)
212{
213 if (cpu_is_pxa3xx() || cpu_is_pxa95x())
214 return sysdev_class_register(&pxa3xx_clock_sysclass);
215 return 0;
216}
217postcore_initcall(pxa3xx_clock_init);