aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s3c2412/pm.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2011-04-22 16:03:21 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2011-04-24 13:16:10 -0400
commitbb072c3cf21d1c9a5a2eeb5a00679ee7bf39675b (patch)
tree8b9b425422e11c5cb5012adf68e9e2a3e957358f /arch/arm/mach-s3c2412/pm.c
parent2eaa03b5bebd1e80014f780d7bf27c3e66daefd6 (diff)
ARM / Samsung: Use struct syscore_ops for "core" power management
Replace sysdev classes and struct sys_device objects used for "core" power management by Samsung platforms with struct syscore_ops objects that are simpler. This generally 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> Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s3c2412/pm.c')
-rw-r--r--arch/arm/mach-s3c2412/pm.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/arch/arm/mach-s3c2412/pm.c b/arch/arm/mach-s3c2412/pm.c
index a7417c479ffe..752b13a7b3db 100644
--- a/arch/arm/mach-s3c2412/pm.c
+++ b/arch/arm/mach-s3c2412/pm.c
@@ -17,6 +17,7 @@
17#include <linux/timer.h> 17#include <linux/timer.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/sysdev.h> 19#include <linux/sysdev.h>
20#include <linux/syscore_ops.h>
20#include <linux/platform_device.h> 21#include <linux/platform_device.h>
21#include <linux/io.h> 22#include <linux/io.h>
22 23
@@ -86,13 +87,24 @@ static struct sleep_save s3c2412_sleep[] = {
86 SAVE_ITEM(S3C2413_GPJSLPCON), 87 SAVE_ITEM(S3C2413_GPJSLPCON),
87}; 88};
88 89
89static int s3c2412_pm_suspend(struct sys_device *dev, pm_message_t state) 90static struct sysdev_driver s3c2412_pm_driver = {
91 .add = s3c2412_pm_add,
92};
93
94static __init int s3c2412_pm_init(void)
95{
96 return sysdev_driver_register(&s3c2412_sysclass, &s3c2412_pm_driver);
97}
98
99arch_initcall(s3c2412_pm_init);
100
101static int s3c2412_pm_suspend(void)
90{ 102{
91 s3c_pm_do_save(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep)); 103 s3c_pm_do_save(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep));
92 return 0; 104 return 0;
93} 105}
94 106
95static int s3c2412_pm_resume(struct sys_device *dev) 107static void s3c2412_pm_resume(void)
96{ 108{
97 unsigned long tmp; 109 unsigned long tmp;
98 110
@@ -102,18 +114,9 @@ static int s3c2412_pm_resume(struct sys_device *dev)
102 __raw_writel(tmp, S3C2412_PWRCFG); 114 __raw_writel(tmp, S3C2412_PWRCFG);
103 115
104 s3c_pm_do_restore(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep)); 116 s3c_pm_do_restore(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep));
105 return 0;
106} 117}
107 118
108static struct sysdev_driver s3c2412_pm_driver = { 119struct syscore_ops s3c2412_pm_syscore_ops = {
109 .add = s3c2412_pm_add,
110 .suspend = s3c2412_pm_suspend, 120 .suspend = s3c2412_pm_suspend,
111 .resume = s3c2412_pm_resume, 121 .resume = s3c2412_pm_resume,
112}; 122};
113
114static __init int s3c2412_pm_init(void)
115{
116 return sysdev_driver_register(&s3c2412_sysclass, &s3c2412_pm_driver);
117}
118
119arch_initcall(s3c2412_pm_init);