aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/mfp-pxa2xx.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/mfp-pxa2xx.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/mfp-pxa2xx.c')
-rw-r--r--arch/arm/mach-pxa/mfp-pxa2xx.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/arch/arm/mach-pxa/mfp-pxa2xx.c b/arch/arm/mach-pxa/mfp-pxa2xx.c
index 1d1419b73457..87ae3129f4f7 100644
--- a/arch/arm/mach-pxa/mfp-pxa2xx.c
+++ b/arch/arm/mach-pxa/mfp-pxa2xx.c
@@ -16,7 +16,7 @@
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/sysdev.h> 19#include <linux/syscore_ops.h>
20 20
21#include <mach/gpio.h> 21#include <mach/gpio.h>
22#include <mach/pxa2xx-regs.h> 22#include <mach/pxa2xx-regs.h>
@@ -338,7 +338,7 @@ static unsigned long saved_gafr[2][4];
338static unsigned long saved_gpdr[4]; 338static unsigned long saved_gpdr[4];
339static unsigned long saved_pgsr[4]; 339static unsigned long saved_pgsr[4];
340 340
341static int pxa2xx_mfp_suspend(struct sys_device *d, pm_message_t state) 341static int pxa2xx_mfp_suspend(void)
342{ 342{
343 int i; 343 int i;
344 344
@@ -365,7 +365,7 @@ static int pxa2xx_mfp_suspend(struct sys_device *d, pm_message_t state)
365 return 0; 365 return 0;
366} 366}
367 367
368static int pxa2xx_mfp_resume(struct sys_device *d) 368static void pxa2xx_mfp_resume(void)
369{ 369{
370 int i; 370 int i;
371 371
@@ -376,15 +376,13 @@ static int pxa2xx_mfp_resume(struct sys_device *d)
376 PGSR(i) = saved_pgsr[i]; 376 PGSR(i) = saved_pgsr[i];
377 } 377 }
378 PSSR = PSSR_RDH | PSSR_PH; 378 PSSR = PSSR_RDH | PSSR_PH;
379 return 0;
380} 379}
381#else 380#else
382#define pxa2xx_mfp_suspend NULL 381#define pxa2xx_mfp_suspend NULL
383#define pxa2xx_mfp_resume NULL 382#define pxa2xx_mfp_resume NULL
384#endif 383#endif
385 384
386struct sysdev_class pxa2xx_mfp_sysclass = { 385struct syscore_ops pxa2xx_mfp_syscore_ops = {
387 .name = "mfp",
388 .suspend = pxa2xx_mfp_suspend, 386 .suspend = pxa2xx_mfp_suspend,
389 .resume = pxa2xx_mfp_resume, 387 .resume = pxa2xx_mfp_resume,
390}; 388};
@@ -409,6 +407,6 @@ static int __init pxa2xx_mfp_init(void)
409 for (i = 0; i <= gpio_to_bank(pxa_last_gpio); i++) 407 for (i = 0; i <= gpio_to_bank(pxa_last_gpio); i++)
410 gpdr_lpm[i] = GPDR(i * 32); 408 gpdr_lpm[i] = GPDR(i * 32);
411 409
412 return sysdev_class_register(&pxa2xx_mfp_sysclass); 410 return 0;
413} 411}
414postcore_initcall(pxa2xx_mfp_init); 412postcore_initcall(pxa2xx_mfp_init);