]> git.hungrycats.org Git - linux/commitdiff
[ARM] Remove "struct device" from sa1111_init() callers
authorRussell King <rmk@flint.arm.linux.org.uk>
Mon, 30 Sep 2002 22:04:23 +0000 (23:04 +0100)
committerRussell King <rmk@flint.arm.linux.org.uk>
Mon, 30 Sep 2002 22:04:23 +0000 (23:04 +0100)
This didn't follow the LDM model correctly.  The SA1111 is always
a device on the root bus.

arch/arm/mach-sa1100/adsbitsy.c
arch/arm/mach-sa1100/badge4.c
arch/arm/mach-sa1100/graphicsmaster.c
arch/arm/mach-sa1100/jornada720.c
arch/arm/mach-sa1100/neponset.c
arch/arm/mach-sa1100/pfs168.c
arch/arm/mach-sa1100/sa1111.c
arch/arm/mach-sa1100/sa1111.h [deleted file]
arch/arm/mach-sa1100/system3.c
include/asm-arm/hardware/sa1111.h

index b0c97a9b7b8e87aab0e5c06ea336cb93f119ff08..d5eb9b67744921cafee1f25842269a2833304cb2 100644 (file)
@@ -28,7 +28,6 @@
 #include <asm/mach/serial_sa1100.h>
 
 #include "generic.h"
-#include "sa1111.h"
 
 static int __init adsbitsy_init(void)
 {
@@ -53,7 +52,7 @@ static int __init adsbitsy_init(void)
        /*
         * Probe for SA1111.
         */
-       ret = sa1111_init(NULL, 0x18000000, IRQ_GPIO0);
+       ret = sa1111_init(0x18000000, IRQ_GPIO0);
        if (ret < 0)
                return ret;
 
index aace82ac1870b40e8c70a36a560ff01f17c22369..6136ee54c4730ca8ecd2ed628c9d33817daa39c3 100644 (file)
@@ -32,7 +32,6 @@
 #include <asm/mach/serial_sa1100.h>
 
 #include "generic.h"
-#include "sa1111.h"
 
 static int __init badge4_sa1111_init(void)
 {
@@ -45,7 +44,7 @@ static int __init badge4_sa1111_init(void)
        /*
         * Probe for SA1111.
         */
-       return sa1111_init(NULL, BADGE4_SA1111_BASE, BADGE4_IRQ_GPIO_SA1111);
+       return sa1111_init(BADGE4_SA1111_BASE, BADGE4_IRQ_GPIO_SA1111);
 }
 
 static int __init badge4_init(void)
index 9600b3e620b5c824b8dddbbd45218bb3dc8c08c7..d3eddf63205e00db84d6b2cf95fdcfd346d4e145 100644 (file)
@@ -25,7 +25,6 @@
 #include <asm/mach/serial_sa1100.h>
 
 #include "generic.h"
-#include "sa1111.h"
 
 static int __init graphicsmaster_init(void)
 {
@@ -43,7 +42,7 @@ static int __init graphicsmaster_init(void)
        /*
         * Probe for SA1111.
         */
-       ret = sa1111_init(NULL, 0x18000000, ADS_EXT_IRQ(0));
+       ret = sa1111_init(0x18000000, ADS_EXT_IRQ(0));
        if (ret < 0)
                return ret;
 
index 3ff0f6999a2f621eacbcdd55e2bbe37c27a8a98b..a735626790258791f3feed102b20cc846ddb8440 100644 (file)
@@ -16,7 +16,6 @@
 #include <asm/mach/serial_sa1100.h>
 
 #include "generic.h"
-#include "sa1111.h"
 
 
 #define JORTUCR_VAL    0x20000400
@@ -46,11 +45,7 @@ static int __init jornada720_init(void)
        PPSR &= ~(PPC_LDD3 | PPC_LDD4);
        PPDR |= PPC_LDD3 | PPC_LDD4;
 
-       /* initialize extra IRQs */
-       set_GPIO_IRQ_edge(GPIO_GPIO1, GPIO_RISING_EDGE);
-       sa1111_init_irq(IRQ_GPIO1);     /* chained on GPIO 1 */
-
-       return 0;
+       return sa1111_init(0x40000000, IRQ_GPIO1);
 }
 
 arch_initcall(jornada720_init);
index ef95e6c45f84bd529b3dcca01b878f110c40f128..9d3a939de4ae896adcf34aa3e6716060caeed674 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/ioport.h>
 #include <linux/serial_core.h>
 #include <linux/device.h>
+#include <linux/slab.h>
 
 #include <asm/hardware.h>
 #include <asm/mach-types.h>
 #include <asm/hardware/sa1111.h>
 #include <asm/sizes.h>
 
-#include "sa1111.h"
-
-static struct device neponset_device = {
-       .name   = "Neponset",
-       .bus_id = "nep_bus",
-};
-
 /*
  * Install handler for Neponset IRQ.  Note that we have to loop here
  * since the ETHERNET and USAR IRQs are level based, and we need to
@@ -163,6 +157,52 @@ static struct sa1100_port_fns neponset_port_fns __initdata = {
        .get_mctrl      = neponset_get_mctrl,
 };
 
+/*
+ * LDM power management.
+ */
+static int neponset_suspend(struct device *dev, u32 state, u32 level)
+{
+       /*
+        * Save state.
+        */
+       if (level == SUSPEND_SAVE_STATE ||
+           level == SUSPEND_DISABLE ||
+           level == SUSPEND_POWER_DOWN) {
+               if (!dev->saved_state)
+                       dev->saved_state = kmalloc(sizeof(unsigned int), GFP_KERNEL);
+               if (!dev->saved_state)
+                       return -ENOMEM;
+
+               *(unsigned int *)dev->saved_state = NCR_0;
+       }
+
+       return 0;
+}
+
+static int neponset_resume(struct device *dev, u32 level)
+{
+       if (level == RESUME_RESTORE_STATE || level == RESUME_ENABLE) {
+               if (dev->saved_state) {
+                       NCR_0 = *(unsigned int *)dev->saved_state;
+                       kfree(dev->saved_state);
+                       dev->saved_state = NULL;
+               }
+       }
+
+       return 0;
+}
+
+static struct device_driver neponset_device_driver = {
+       .suspend = neponset_suspend,
+       .resume  = neponset_resume,
+};
+
+static struct device neponset_device = {
+       .name   = "Neponset",
+       .bus_id = "neponset",
+       .driver = &neponset_device_driver,
+};
+
 static int __init neponset_init(void)
 {
        int ret;
@@ -191,7 +231,7 @@ static int __init neponset_init(void)
                return -ENODEV;
        }
 
-       ret = device_register(&neponset_device);
+       ret = register_sys_device(&neponset_device);
        if (ret)
                return ret;
 
@@ -213,7 +253,7 @@ static int __init neponset_init(void)
        /*
         * Probe and initialise the SA1111.
         */
-       return sa1111_init(&neponset_device, 0x40000000, IRQ_NEPONSET_SA1111);
+       return sa1111_init(0x40000000, IRQ_NEPONSET_SA1111);
 }
 
 arch_initcall(neponset_init);
index 2b62878b4e7c431c1cdacd8fc36a086bcd0feb85..d17c1a79e7857247c9f950dee083aafa46043ed3 100644 (file)
@@ -17,7 +17,6 @@
 #include <asm/mach/serial_sa1100.h>
 
 #include "generic.h"
-#include "sa1111.h"
 
 
 static int __init pfs168_init(void)
@@ -36,7 +35,7 @@ static int __init pfs168_init(void)
        /*
         * Probe for SA1111.
         */
-       return sa1111_init(NULL, 0x40000000, IRQ_GPIO25);
+       return sa1111_init(0x40000000, IRQ_GPIO25);
 }
 
 arch_initcall(pfs168_init);
index 8d796a67622a790184258e3ab9b286bc00693574..0e769054b8c04d493050dc9301fd04efeb29ce66 100644 (file)
@@ -650,7 +650,7 @@ int sa1111_check_dma_bug(dma_addr_t addr)
        return 0;
 }
 
-int sa1111_init(struct device *parent, unsigned long phys, unsigned int irq)
+int sa1111_init(unsigned long phys, unsigned int irq)
 {
        unsigned int val;
        int ret;
diff --git a/arch/arm/mach-sa1100/sa1111.h b/arch/arm/mach-sa1100/sa1111.h
deleted file mode 100644 (file)
index e3a13f6..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * linux/arch/arm/mach-sa1100/sa1111.h
- */
-struct device;
-
-/*
- * Probe for a SA1111 chip.
- */
-extern int
-sa1111_init(struct device *parent, unsigned long phys, unsigned int irq);
-
-/*
- * Wake up a SA1111 chip.
- */
-extern void sa1111_wake(void);
-
-/*
- * Doze the SA1111 chip.
- */
-extern void sa1111_doze(void);
index 0629aa5420ce30cb711f76b70c3ac573a93ec092..d0dc614b0b875438d48df8a47e4f0466e48d2584 100644 (file)
@@ -56,7 +56,6 @@
 #include <linux/serial_core.h>
 
 #include "generic.h"
-#include "sa1111.h"
 #include <asm/hardware/sa1111.h>
 
 #define DEBUG 1
@@ -401,7 +400,7 @@ static int __init system3_init(void)
        /*
         * Probe for a SA1111.
         */
-       ret = sa1111_init(NULL, PT_SA1111_BASE, IRQ_SYSTEM3_SA1111);
+       ret = sa1111_init(PT_SA1111_BASE, IRQ_SYSTEM3_SA1111);
        if (ret < 0) {
                printk( KERN_WARNING"PT Digital Board: no SA1111 found!\n" );
                goto DONE;
index 58774d1092ebc7ee10555798226f50a28bcee579..311e4832eb2fbc0639763d818a380d2df0b17028 100644 (file)
@@ -580,6 +580,11 @@ struct sa1111_driver {
 
 #define SA1111_DRIVER_NAME(_sadev) ((_sadev)->dev.driver->name)
 
+/*
+ * Probe for a SA1111 chip.
+ */
+extern int sa1111_init(unsigned long phys, unsigned int irq);
+
 /*
  * These frob the SKPCR register.
  */