Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5698bd28c67775c722dc1f4ab82e0041c1c740ea
Commit:     5698bd28c67775c722dc1f4ab82e0041c1c740ea
Parent:     55ba86bc6c33ce8b690fdf20ab485ef94cccd423
Author:     Ben Dooks <[EMAIL PROTECTED]>
AuthorDate: Wed Jun 6 10:36:09 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Mon Jun 11 09:09:31 2007 +0100

    [ARM] 4444/2: OSIRIS: CPLD suspend fix
    
    Ensure the CPLD 8bit settings are preserved over a suspend/resume
    cycle as the CPU sends a hard-reset at resume time.
    
    Signed-off-by: Ben Dooks <[EMAIL PROTECTED]>
    Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-s3c2440/mach-osiris.c        |   39 ++++++++++++++++++++++++++++
 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 64da36a..1581160 100644
--- a/arch/arm/mach-s3c2440/mach-osiris.c
+++ b/arch/arm/mach-s3c2440/mach-osiris.c
@@ -16,6 +16,7 @@
 #include <linux/timer.h>
 #include <linux/init.h>
 #include <linux/device.h>
+#include <linux/sysdev.h>
 #include <linux/serial_core.h>
 
 #include <asm/mach/arch.h>
@@ -245,6 +246,40 @@ static struct platform_device osiris_pcmcia = {
        .resource       = osiris_pcmcia_resource,
 };
 
+/* Osiris power management device */
+
+#ifdef CONFIG_PM
+static unsigned char pm_osiris_ctrl0;
+
+static int osiris_pm_suspend(struct sys_device *sd, pm_message_t state)
+{
+       pm_osiris_ctrl0 = __raw_readb(OSIRIS_VA_CTRL0);
+       return 0;
+}
+
+static int osiris_pm_resume(struct sys_device *sd)
+{
+       if (pm_osiris_ctrl0 & OSIRIS_CTRL0_FIX8)
+               __raw_writeb(OSIRIS_CTRL1_FIX8, OSIRIS_VA_CTRL1);
+
+       return 0;
+}
+
+#else
+#define osiris_pm_suspend NULL
+#define osiris_pm_resume NULL
+#endif
+
+static struct sysdev_class osiris_pm_sysclass = {
+       set_kset_name("mach-osiris"),
+       .suspend        = osiris_pm_suspend,
+       .resume         = osiris_pm_resume,
+};
+
+static struct sys_device osiris_pm_sysdev = {
+       .cls            = &osiris_pm_sysclass,
+};
+
 /* Standard Osiris devices */
 
 static struct platform_device *osiris_devices[] __initdata = {
@@ -299,6 +334,9 @@ static void __init osiris_map_io(void)
 
 static void __init osiris_init(void)
 {
+       sysdev_class_register(&osiris_pm_sysclass);
+       sysdev_register(&osiris_pm_sysdev);
+
        platform_add_devices(osiris_devices, ARRAY_SIZE(osiris_devices));
 };
 
@@ -310,5 +348,6 @@ MACHINE_START(OSIRIS, "Simtec-OSIRIS")
        .map_io         = osiris_map_io,
        .init_machine   = osiris_init,
        .init_irq       = s3c24xx_init_irq,
+       .init_machine   = osiris_init,
        .timer          = &s3c24xx_timer,
 MACHINE_END
diff --git a/include/asm-arm/arch-s3c2410/osiris-cpld.h 
b/include/asm-arm/arch-s3c2410/osiris-cpld.h
index a3253e9..229ab23 100644
--- a/include/asm-arm/arch-s3c2410/osiris-cpld.h
+++ b/include/asm-arm/arch-s3c2410/osiris-cpld.h
@@ -1,6 +1,6 @@
 /* linux/include/asm-arm/arch-s3c2410/osiris-cpld.h
  *
- * Copyright (c) 2005 Simtec Electronics
+ * Copyright 2005 Simtec Electronics
  *     http://www.simtec.co.uk/products/
  *     Ben Dooks <[EMAIL PROTECTED]>
  *
@@ -19,9 +19,12 @@
 #define OSIRIS_CTRL0_NANDSEL           (0x3)
 #define OSIRIS_CTRL0_BOOT_INT          (1<<3)
 #define OSIRIS_CTRL0_PCMCIA            (1<<4)
+#define OSIRIS_CTRL0_FIX8              (1<<5)
 #define OSIRIS_CTRL0_PCMCIA_nWAIT      (1<<6)
 #define OSIRIS_CTRL0_PCMCIA_nIOIS16    (1<<7)
 
+#define OSIRIS_CTRL1_FIX8              (1<<0)
+
 #define OSIRIS_ID_REVMASK              (0x7)
 
 #endif /* __ASM_ARCH_OSIRISCPLD_H */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to