[ARM] pxa: move pm_ops structure into CPU specific files
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Tue, 15 May 2007 10:16:10 +0000 (11:16 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 12 Jul 2007 13:28:05 +0000 (14:28 +0100)
Move the pm_ops structure into the PXA25x and PXA27x support
files.  Remove the old pxa_pm_prepare() function, and rename
the both pxa_cpu_pm_prepare() functions as pxa_pm_prepare().
We'll fix that later.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-pxa/pm.c
arch/arm/mach-pxa/pxa25x.c
arch/arm/mach-pxa/pxa27x.c

index 6d86203aef7b410203e0558ba1c34a4a24e09e6c..d439ffa1b07139668b461d3c535d8ff5469f2e06 100644 (file)
@@ -200,29 +200,3 @@ unsigned long sleep_phys_sp(void *sp)
 {
        return virt_to_phys(sp);
 }
-
-/*
- * Called after processes are frozen, but before we shut down devices.
- */
-int pxa_pm_prepare(suspend_state_t state)
-{
-       extern int pxa_cpu_pm_prepare(suspend_state_t state);
-
-       return pxa_cpu_pm_prepare(state);
-}
-
-EXPORT_SYMBOL_GPL(pxa_pm_prepare);
-
-static struct pm_ops pxa_pm_ops = {
-       .prepare        = pxa_pm_prepare,
-       .enter          = pxa_pm_enter,
-       .valid          = pm_valid_only_mem,
-};
-
-static int __init pxa_pm_init(void)
-{
-       pm_set_ops(&pxa_pm_ops);
-       return 0;
-}
-
-device_initcall(pxa_pm_init);
index c1f21739bf714a435dc7b3df21c3fc2c488e152b..8560439ba0b909cc7c31e8c3cc8f31a728ee4c32 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <asm/hardware.h>
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pm.h>
 
 #include "generic.h"
 
@@ -105,7 +106,7 @@ EXPORT_SYMBOL(get_lcdclk_frequency_10khz);
 
 #ifdef CONFIG_PM
 
-int pxa_cpu_pm_prepare(suspend_state_t state)
+int pxa_pm_prepare(suspend_state_t state)
 {
        switch (state) {
        case PM_SUSPEND_MEM:
@@ -133,4 +134,21 @@ void pxa_cpu_pm_enter(suspend_state_t state)
        }
 }
 
+static struct pm_ops pxa25x_pm_ops = {
+       .prepare        = pxa_pm_prepare,
+       .enter          = pxa_pm_enter,
+       .valid          = pm_valid_only_mem,
+};
 #endif
+
+static int __init pxa25x_init(void)
+{
+       if (cpu_is_pxa21x() || cpu_is_pxa25x()) {
+#ifdef CONFIG_PM
+               pm_set_ops(&pxa25x_pm_ops);
+#endif
+       }
+       return 0; 
+}
+
+subsys_initcall(pxa25x_init);
index 1939acc3f9f7f6cdbd21e9d4fbc07ed55230686a..be6ca7d3afa28f1bd50fa72c57b76859f3ec2e34 100644 (file)
@@ -21,6 +21,7 @@
 #include <asm/irq.h>
 #include <asm/arch/pxa-regs.h>
 #include <asm/arch/ohci.h>
+#include <asm/arch/pm.h>
 
 #include "generic.h"
 
@@ -122,7 +123,7 @@ EXPORT_SYMBOL(get_lcdclk_frequency_10khz);
 
 #ifdef CONFIG_PM
 
-int pxa_cpu_pm_prepare(suspend_state_t state)
+int pxa_pm_prepare(suspend_state_t state)
 {
        switch (state) {
        case PM_SUSPEND_MEM:
@@ -162,6 +163,11 @@ void pxa_cpu_pm_enter(suspend_state_t state)
        }
 }
 
+static struct pm_ops pxa27x_pm_ops = {
+       .prepare        = pxa_pm_prepare,
+       .enter          = pxa_pm_enter,
+       .valid          = pm_valid_only_mem,
+};
 #endif
 
 /*
@@ -205,7 +211,14 @@ static struct platform_device *devices[] __initdata = {
 
 static int __init pxa27x_init(void)
 {
-       return platform_add_devices(devices, ARRAY_SIZE(devices));
+       int ret = 0;
+       if (cpu_is_pxa27x()) {
+#ifdef CONFIG_PM
+               pm_set_ops(&pxa27x_pm_ops);
+#endif
+               ret = platform_add_devices(devices, ARRAY_SIZE(devices));
+       }
+       return ret;
 }
 
 subsys_initcall(pxa27x_init);