diff options
-rw-r--r-- | arch/arm/mach-s3c2440/mach-osiris.c | 39 | ||||
-rw-r--r-- | include/asm-arm/arch-s3c2410/osiris-cpld.h | 5 |
2 files changed, 43 insertions, 1 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 |
diff --git a/include/asm-arm/arch-s3c2410/osiris-cpld.h b/include/asm-arm/arch-s3c2410/osiris-cpld.h index a3253e979efe..229ab2351db6 100644 --- a/include/asm-arm/arch-s3c2410/osiris-cpld.h +++ b/include/asm-arm/arch-s3c2410/osiris-cpld.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* linux/include/asm-arm/arch-s3c2410/osiris-cpld.h | 1 | /* linux/include/asm-arm/arch-s3c2410/osiris-cpld.h |
2 | * | 2 | * |
3 | * Copyright (c) 2005 Simtec Electronics | 3 | * Copyright 2005 Simtec Electronics |
4 | * http://www.simtec.co.uk/products/ | 4 | * http://www.simtec.co.uk/products/ |
5 | * Ben Dooks <ben@simtec.co.uk> | 5 | * Ben Dooks <ben@simtec.co.uk> |
6 | * | 6 | * |
@@ -19,9 +19,12 @@ | |||
19 | #define OSIRIS_CTRL0_NANDSEL (0x3) | 19 | #define OSIRIS_CTRL0_NANDSEL (0x3) |
20 | #define OSIRIS_CTRL0_BOOT_INT (1<<3) | 20 | #define OSIRIS_CTRL0_BOOT_INT (1<<3) |
21 | #define OSIRIS_CTRL0_PCMCIA (1<<4) | 21 | #define OSIRIS_CTRL0_PCMCIA (1<<4) |
22 | #define OSIRIS_CTRL0_FIX8 (1<<5) | ||
22 | #define OSIRIS_CTRL0_PCMCIA_nWAIT (1<<6) | 23 | #define OSIRIS_CTRL0_PCMCIA_nWAIT (1<<6) |
23 | #define OSIRIS_CTRL0_PCMCIA_nIOIS16 (1<<7) | 24 | #define OSIRIS_CTRL0_PCMCIA_nIOIS16 (1<<7) |
24 | 25 | ||
26 | #define OSIRIS_CTRL1_FIX8 (1<<0) | ||
27 | |||
25 | #define OSIRIS_ID_REVMASK (0x7) | 28 | #define OSIRIS_ID_REVMASK (0x7) |
26 | 29 | ||
27 | #endif /* __ASM_ARCH_OSIRISCPLD_H */ | 30 | #endif /* __ASM_ARCH_OSIRISCPLD_H */ |