Merge branch 'pci-for-jesse' of git://git.kernel.org/pub/scm/linux/kernel/git/x86...
[pandora-kernel.git] / arch / arm / mach-s3c2410 / mach-bast.c
index 6617547..27f63d5 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/list.h>
 #include <linux/timer.h>
 #include <linux/init.h>
+#include <linux/sysdev.h>
 #include <linux/serial_core.h>
 #include <linux/platform_device.h>
 #include <linux/dm9000.h>
@@ -236,6 +237,36 @@ static struct platform_device bast_device_nor = {
 
 /* NAND Flash on BAST board */
 
+#ifdef CONFIG_PM
+static int bast_pm_suspend(struct sys_device *sd, pm_message_t state)
+{
+       /* ensure that an nRESET is not generated on resume. */
+       s3c2410_gpio_setpin(S3C2410_GPA21, 1);
+       s3c2410_gpio_cfgpin(S3C2410_GPA21, S3C2410_GPA21_OUT);
+
+       return 0;
+}
+
+static int bast_pm_resume(struct sys_device *sd)
+{
+       s3c2410_gpio_cfgpin(S3C2410_GPA21, S3C2410_GPA21_nRSTOUT);
+       return 0;
+}
+
+#else
+#define bast_pm_suspend NULL
+#define bast_pm_resume NULL
+#endif
+
+static struct sysdev_class bast_pm_sysclass = {
+       .name           = "mach-bast",
+       .suspend        = bast_pm_suspend,
+       .resume         = bast_pm_resume,
+};
+
+static struct sys_device bast_pm_sysdev = {
+       .cls            = &bast_pm_sysclass,
+};
 
 static int smartmedia_map[] = { 0 };
 static int chip0_map[] = { 1 };
@@ -343,7 +374,7 @@ static struct resource bast_dm9k_resource[] = {
        [2] = {
                .start = IRQ_DM9000,
                .end   = IRQ_DM9000,
-               .flags = IORESOURCE_IRQ,
+               .flags = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH,
        }
 
 };
@@ -561,10 +592,10 @@ static void __init bast_map_io(void)
 {
        /* initialise the clocks */
 
-       s3c24xx_dclk0.parent = NULL;
+       s3c24xx_dclk0.parent = &clk_upll;
        s3c24xx_dclk0.rate   = 12*1000*1000;
 
-       s3c24xx_dclk1.parent = NULL;
+       s3c24xx_dclk1.parent = &clk_upll;
        s3c24xx_dclk1.rate   = 24*1000*1000;
 
        s3c24xx_clkout0.parent  = &s3c24xx_dclk0;
@@ -586,6 +617,9 @@ static void __init bast_map_io(void)
 
 static void __init bast_init(void)
 {
+       sysdev_class_register(&bast_pm_sysclass);
+       sysdev_register(&bast_pm_sysdev);
+
        s3c24xx_fb_set_platdata(&bast_fb_info);
        platform_add_devices(bast_devices, ARRAY_SIZE(bast_devices));
 }