]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-pxa/pxa25x.c
Merge branch 'for-rmk' of git://pasiphae.extern.pengutronix.de/git/imx/linux-2.6.git
[linux-2.6-omap-h63xx.git] / arch / arm / mach-pxa / pxa25x.c
index f0eda2094494ab3d1a460cda10ddfa6a112d5aea..25d17a1dab78bd68606224d233e6660960de0300 100644 (file)
 #include "devices.h"
 #include "clock.h"
 
+int cpu_is_pxa26x(void)
+{
+       return cpu_is_pxa250() && ((BOOT_DEF & 0x8) == 0);
+}
+EXPORT_SYMBOL_GPL(cpu_is_pxa26x);
+
 /*
  * Various clock factors driven by the CCCR register.
  */
@@ -218,9 +224,6 @@ static void pxa25x_cpu_pm_save(unsigned long *sleep_save)
 
 static void pxa25x_cpu_pm_restore(unsigned long *sleep_save)
 {
-       /* ensure not to come back here if it wasn't intended */
-       PSPR = 0;
-
        RESTORE(CKEN);
        RESTORE(PSTR);
 }
@@ -232,19 +235,32 @@ static void pxa25x_cpu_pm_enter(suspend_state_t state)
 
        switch (state) {
        case PM_SUSPEND_MEM:
-               /* set resume return address */
-               PSPR = virt_to_phys(pxa_cpu_resume);
                pxa25x_cpu_suspend(PWRMODE_SLEEP);
                break;
        }
 }
 
+static int pxa25x_cpu_pm_prepare(void)
+{
+       /* set resume return address */
+       PSPR = virt_to_phys(pxa_cpu_resume);
+       return 0;
+}
+
+static void pxa25x_cpu_pm_finish(void)
+{
+       /* ensure not to come back here if it wasn't intended */
+       PSPR = 0;
+}
+
 static struct pxa_cpu_pm_fns pxa25x_cpu_pm_fns = {
        .save_count     = SLEEP_SAVE_COUNT,
        .valid          = suspend_valid_only_mem,
        .save           = pxa25x_cpu_pm_save,
        .restore        = pxa25x_cpu_pm_restore,
        .enter          = pxa25x_cpu_pm_enter,
+       .prepare        = pxa25x_cpu_pm_prepare,
+       .finish         = pxa25x_cpu_pm_finish,
 };
 
 static void __init pxa25x_init_pm(void)
@@ -316,11 +332,7 @@ static int __init pxa25x_init(void)
 {
        int i, ret = 0;
 
-       /* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */
-       if (cpu_is_pxa255())
-               clks_register(&pxa25x_hwuart_clk, 1);
-
-       if (cpu_is_pxa21x() || cpu_is_pxa25x()) {
+       if (cpu_is_pxa25x()) {
 
                reset_status = RCSR;
 
@@ -343,9 +355,11 @@ static int __init pxa25x_init(void)
                        return ret;
        }
 
-       /* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */
-       if (cpu_is_pxa255())
+       /* Only add HWUART for PXA255/26x; PXA210/250 do not have it. */
+       if (cpu_is_pxa255() || cpu_is_pxa26x()) {
+               clks_register(&pxa25x_hwuart_clk, 1);
                ret = platform_device_register(&pxa_device_hwuart);
+       }
 
        return ret;
 }