diff options
Diffstat (limited to 'arch/arm/mach-s3c2410/mach-bast.c')
-rw-r--r-- | arch/arm/mach-s3c2410/mach-bast.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c index 66175471fff3..b45fb65889d2 100644 --- a/arch/arm/mach-s3c2410/mach-bast.c +++ b/arch/arm/mach-s3c2410/mach-bast.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/list.h> | 16 | #include <linux/list.h> |
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/serial_core.h> | 20 | #include <linux/serial_core.h> |
20 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
21 | #include <linux/dm9000.h> | 22 | #include <linux/dm9000.h> |
@@ -236,6 +237,36 @@ static struct platform_device bast_device_nor = { | |||
236 | 237 | ||
237 | /* NAND Flash on BAST board */ | 238 | /* NAND Flash on BAST board */ |
238 | 239 | ||
240 | #ifdef CONFIG_PM | ||
241 | static int bast_pm_suspend(struct sys_device *sd, pm_message_t state) | ||
242 | { | ||
243 | /* ensure that an nRESET is not generated on resume. */ | ||
244 | s3c2410_gpio_setpin(S3C2410_GPA21, 1); | ||
245 | s3c2410_gpio_cfgpin(S3C2410_GPA21, S3C2410_GPA21_OUT); | ||
246 | |||
247 | return 0; | ||
248 | } | ||
249 | |||
250 | static int bast_pm_resume(struct sys_device *sd) | ||
251 | { | ||
252 | s3c2410_gpio_cfgpin(S3C2410_GPA21, S3C2410_GPA21_nRSTOUT); | ||
253 | return 0; | ||
254 | } | ||
255 | |||
256 | #else | ||
257 | #define bast_pm_suspend NULL | ||
258 | #define bast_pm_resume NULL | ||
259 | #endif | ||
260 | |||
261 | static struct sysdev_class bast_pm_sysclass = { | ||
262 | set_kset_name("mach-bast"), | ||
263 | .suspend = bast_pm_suspend, | ||
264 | .resume = bast_pm_resume, | ||
265 | }; | ||
266 | |||
267 | static struct sys_device bast_pm_sysdev = { | ||
268 | .cls = &bast_pm_sysclass, | ||
269 | }; | ||
239 | 270 | ||
240 | static int smartmedia_map[] = { 0 }; | 271 | static int smartmedia_map[] = { 0 }; |
241 | static int chip0_map[] = { 1 }; | 272 | static int chip0_map[] = { 1 }; |
@@ -586,6 +617,9 @@ static void __init bast_map_io(void) | |||
586 | 617 | ||
587 | static void __init bast_init(void) | 618 | static void __init bast_init(void) |
588 | { | 619 | { |
620 | sysdev_class_register(&bast_pm_sysclass); | ||
621 | sysdev_register(&bast_pm_sysdev); | ||
622 | |||
589 | s3c24xx_fb_set_platdata(&bast_fb_info); | 623 | s3c24xx_fb_set_platdata(&bast_fb_info); |
590 | platform_add_devices(bast_devices, ARRAY_SIZE(bast_devices)); | 624 | platform_add_devices(bast_devices, ARRAY_SIZE(bast_devices)); |
591 | } | 625 | } |