diff options
Diffstat (limited to 'arch/arm/mach-s3c2440/mach-osiris.c')
-rw-r--r-- | arch/arm/mach-s3c2440/mach-osiris.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c2440/mach-osiris.c b/arch/arm/mach-s3c2440/mach-osiris.c index 64da36a00644..15811601f03d 100644 --- a/arch/arm/mach-s3c2440/mach-osiris.c +++ b/arch/arm/mach-s3c2440/mach-osiris.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/timer.h> | 16 | #include <linux/timer.h> |
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/device.h> | 18 | #include <linux/device.h> |
19 | #include <linux/sysdev.h> | ||
19 | #include <linux/serial_core.h> | 20 | #include <linux/serial_core.h> |
20 | 21 | ||
21 | #include <asm/mach/arch.h> | 22 | #include <asm/mach/arch.h> |
@@ -245,6 +246,40 @@ static struct platform_device osiris_pcmcia = { | |||
245 | .resource = osiris_pcmcia_resource, | 246 | .resource = osiris_pcmcia_resource, |
246 | }; | 247 | }; |
247 | 248 | ||
249 | /* Osiris power management device */ | ||
250 | |||
251 | #ifdef CONFIG_PM | ||
252 | static unsigned char pm_osiris_ctrl0; | ||
253 | |||
254 | static int osiris_pm_suspend(struct sys_device *sd, pm_message_t state) | ||
255 | { | ||
256 | pm_osiris_ctrl0 = __raw_readb(OSIRIS_VA_CTRL0); | ||
257 | return 0; | ||
258 | } | ||
259 | |||
260 | static int osiris_pm_resume(struct sys_device *sd) | ||
261 | { | ||
262 | if (pm_osiris_ctrl0 & OSIRIS_CTRL0_FIX8) | ||
263 | __raw_writeb(OSIRIS_CTRL1_FIX8, OSIRIS_VA_CTRL1); | ||
264 | |||
265 | return 0; | ||
266 | } | ||
267 | |||
268 | #else | ||
269 | #define osiris_pm_suspend NULL | ||
270 | #define osiris_pm_resume NULL | ||
271 | #endif | ||
272 | |||
273 | static struct sysdev_class osiris_pm_sysclass = { | ||
274 | set_kset_name("mach-osiris"), | ||
275 | .suspend = osiris_pm_suspend, | ||
276 | .resume = osiris_pm_resume, | ||
277 | }; | ||
278 | |||
279 | static struct sys_device osiris_pm_sysdev = { | ||
280 | .cls = &osiris_pm_sysclass, | ||
281 | }; | ||
282 | |||
248 | /* Standard Osiris devices */ | 283 | /* Standard Osiris devices */ |
249 | 284 | ||
250 | static struct platform_device *osiris_devices[] __initdata = { | 285 | static struct platform_device *osiris_devices[] __initdata = { |
@@ -299,6 +334,9 @@ static void __init osiris_map_io(void) | |||
299 | 334 | ||
300 | static void __init osiris_init(void) | 335 | static void __init osiris_init(void) |
301 | { | 336 | { |
337 | sysdev_class_register(&osiris_pm_sysclass); | ||
338 | sysdev_register(&osiris_pm_sysdev); | ||
339 | |||
302 | platform_add_devices(osiris_devices, ARRAY_SIZE(osiris_devices)); | 340 | platform_add_devices(osiris_devices, ARRAY_SIZE(osiris_devices)); |
303 | }; | 341 | }; |
304 | 342 | ||
@@ -310,5 +348,6 @@ MACHINE_START(OSIRIS, "Simtec-OSIRIS") | |||
310 | .map_io = osiris_map_io, | 348 | .map_io = osiris_map_io, |
311 | .init_machine = osiris_init, | 349 | .init_machine = osiris_init, |
312 | .init_irq = s3c24xx_init_irq, | 350 | .init_irq = s3c24xx_init_irq, |
351 | .init_machine = osiris_init, | ||
313 | .timer = &s3c24xx_timer, | 352 | .timer = &s3c24xx_timer, |
314 | MACHINE_END | 353 | MACHINE_END |