diff options
Diffstat (limited to 'arch/arm/mach-s3c2440/s3c244x.c')
-rw-r--r-- | arch/arm/mach-s3c2440/s3c244x.c | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/arch/arm/mach-s3c2440/s3c244x.c b/arch/arm/mach-s3c2440/s3c244x.c index 90c1707b9c95..7e8a23d2098a 100644 --- a/arch/arm/mach-s3c2440/s3c244x.c +++ b/arch/arm/mach-s3c2440/s3c244x.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/serial_core.h> | 19 | #include <linux/serial_core.h> |
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | #include <linux/sysdev.h> | 21 | #include <linux/sysdev.h> |
22 | #include <linux/syscore_ops.h> | ||
22 | #include <linux/clk.h> | 23 | #include <linux/clk.h> |
23 | #include <linux/io.h> | 24 | #include <linux/io.h> |
24 | 25 | ||
@@ -134,45 +135,14 @@ void __init s3c244x_init_clocks(int xtal) | |||
134 | s3c2410_baseclk_add(); | 135 | s3c2410_baseclk_add(); |
135 | } | 136 | } |
136 | 137 | ||
137 | #ifdef CONFIG_PM | ||
138 | |||
139 | static struct sleep_save s3c244x_sleep[] = { | ||
140 | SAVE_ITEM(S3C2440_DSC0), | ||
141 | SAVE_ITEM(S3C2440_DSC1), | ||
142 | SAVE_ITEM(S3C2440_GPJDAT), | ||
143 | SAVE_ITEM(S3C2440_GPJCON), | ||
144 | SAVE_ITEM(S3C2440_GPJUP) | ||
145 | }; | ||
146 | |||
147 | static int s3c244x_suspend(struct sys_device *dev, pm_message_t state) | ||
148 | { | ||
149 | s3c_pm_do_save(s3c244x_sleep, ARRAY_SIZE(s3c244x_sleep)); | ||
150 | return 0; | ||
151 | } | ||
152 | |||
153 | static int s3c244x_resume(struct sys_device *dev) | ||
154 | { | ||
155 | s3c_pm_do_restore(s3c244x_sleep, ARRAY_SIZE(s3c244x_sleep)); | ||
156 | return 0; | ||
157 | } | ||
158 | |||
159 | #else | ||
160 | #define s3c244x_suspend NULL | ||
161 | #define s3c244x_resume NULL | ||
162 | #endif | ||
163 | |||
164 | /* Since the S3C2442 and S3C2440 share items, put both sysclasses here */ | 138 | /* Since the S3C2442 and S3C2440 share items, put both sysclasses here */ |
165 | 139 | ||
166 | struct sysdev_class s3c2440_sysclass = { | 140 | struct sysdev_class s3c2440_sysclass = { |
167 | .name = "s3c2440-core", | 141 | .name = "s3c2440-core", |
168 | .suspend = s3c244x_suspend, | ||
169 | .resume = s3c244x_resume | ||
170 | }; | 142 | }; |
171 | 143 | ||
172 | struct sysdev_class s3c2442_sysclass = { | 144 | struct sysdev_class s3c2442_sysclass = { |
173 | .name = "s3c2442-core", | 145 | .name = "s3c2442-core", |
174 | .suspend = s3c244x_suspend, | ||
175 | .resume = s3c244x_resume | ||
176 | }; | 146 | }; |
177 | 147 | ||
178 | /* need to register class before we actually register the device, and | 148 | /* need to register class before we actually register the device, and |
@@ -194,3 +164,33 @@ static int __init s3c2442_core_init(void) | |||
194 | } | 164 | } |
195 | 165 | ||
196 | core_initcall(s3c2442_core_init); | 166 | core_initcall(s3c2442_core_init); |
167 | |||
168 | |||
169 | #ifdef CONFIG_PM | ||
170 | static struct sleep_save s3c244x_sleep[] = { | ||
171 | SAVE_ITEM(S3C2440_DSC0), | ||
172 | SAVE_ITEM(S3C2440_DSC1), | ||
173 | SAVE_ITEM(S3C2440_GPJDAT), | ||
174 | SAVE_ITEM(S3C2440_GPJCON), | ||
175 | SAVE_ITEM(S3C2440_GPJUP) | ||
176 | }; | ||
177 | |||
178 | static int s3c244x_suspend(void) | ||
179 | { | ||
180 | s3c_pm_do_save(s3c244x_sleep, ARRAY_SIZE(s3c244x_sleep)); | ||
181 | return 0; | ||
182 | } | ||
183 | |||
184 | static void s3c244x_resume(void) | ||
185 | { | ||
186 | s3c_pm_do_restore(s3c244x_sleep, ARRAY_SIZE(s3c244x_sleep)); | ||
187 | } | ||
188 | #else | ||
189 | #define s3c244x_suspend NULL | ||
190 | #define s3c244x_resume NULL | ||
191 | #endif | ||
192 | |||
193 | struct syscore_ops s3c244x_pm_syscore_ops = { | ||
194 | .suspend = s3c244x_suspend, | ||
195 | .resume = s3c244x_resume, | ||
196 | }; | ||