]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-pxa/pxa27x.c
[ARM] pxa: Allow platforms to override PSPR setting
[linux-2.6-omap-h63xx.git] / arch / arm / mach-pxa / pxa27x.c
index 4d7afae352a1cd5f03c01596f1d93d394e1c0a75..4835207c142680c733b437aca03397e9404de8e9 100644 (file)
 #include <linux/platform_device.h>
 #include <linux/sysdev.h>
 
-#include <asm/hardware.h>
+#include <mach/hardware.h>
 #include <asm/irq.h>
-#include <asm/arch/irqs.h>
-#include <asm/arch/pxa-regs.h>
-#include <asm/arch/pxa2xx-regs.h>
-#include <asm/arch/mfp-pxa27x.h>
-#include <asm/arch/ohci.h>
-#include <asm/arch/pm.h>
-#include <asm/arch/dma.h>
-#include <asm/arch/i2c.h>
+#include <mach/irqs.h>
+#include <mach/pxa-regs.h>
+#include <mach/pxa2xx-regs.h>
+#include <mach/mfp-pxa27x.h>
+#include <mach/reset.h>
+#include <mach/ohci.h>
+#include <mach/pm.h>
+#include <mach/dma.h>
+#include <mach/i2c.h>
 
 #include "generic.h"
 #include "devices.h"
@@ -146,7 +147,7 @@ static struct clk pxa27x_clks[] = {
 
        INIT_CKEN("I2SCLK",  I2S,  14682000, 0, &pxa_device_i2s.dev),
        INIT_CKEN("I2CCLK",  I2C,  32842000, 0, &pxa_device_i2c.dev),
-       INIT_CKEN("UDCCLK",  USB,  48000000, 5, &pxa_device_udc.dev),
+       INIT_CKEN("UDCCLK",  USB,  48000000, 5, &pxa27x_device_udc.dev),
        INIT_CKEN("MMCCLK",  MMC,  19500000, 0, &pxa_device_mci.dev),
        INIT_CKEN("FICPCLK", FICP, 48000000, 0, &pxa_device_ficp.dev),
 
@@ -219,9 +220,6 @@ void pxa27x_cpu_pm_save(unsigned long *sleep_save)
 
 void pxa27x_cpu_pm_restore(unsigned long *sleep_save)
 {
-       /* ensure not to come back here if it wasn't intended */
-       PSPR = 0;
-
        /* restore registers */
        RESTORE(GAFR0_L); RESTORE(GAFR0_U);
        RESTORE(GAFR1_L); RESTORE(GAFR1_U);
@@ -258,8 +256,6 @@ void pxa27x_cpu_pm_enter(suspend_state_t state)
                pxa_cpu_standby();
                break;
        case PM_SUSPEND_MEM:
-               /* set resume return address */
-               PSPR = virt_to_phys(pxa_cpu_resume);
                pxa27x_cpu_suspend(PWRMODE_SLEEP);
                break;
        }
@@ -270,12 +266,27 @@ static int pxa27x_cpu_pm_valid(suspend_state_t state)
        return state == PM_SUSPEND_MEM || state == PM_SUSPEND_STANDBY;
 }
 
+static int pxa27x_cpu_pm_prepare(void)
+{
+       /* set resume return address */
+       PSPR = virt_to_phys(pxa_cpu_resume);
+       return 0;
+}
+
+static void pxa27x_cpu_pm_finish(void)
+{
+       /* ensure not to come back here if it wasn't intended */
+       PSPR = 0;
+}
+
 static struct pxa_cpu_pm_fns pxa27x_cpu_pm_fns = {
        .save_count     = SLEEP_SAVE_COUNT,
        .save           = pxa27x_cpu_pm_save,
        .restore        = pxa27x_cpu_pm_restore,
        .valid          = pxa27x_cpu_pm_valid,
        .enter          = pxa27x_cpu_pm_enter,
+       .prepare        = pxa27x_cpu_pm_prepare,
+       .finish         = pxa27x_cpu_pm_finish,
 };
 
 static void __init pxa27x_init_pm(void)
@@ -348,7 +359,7 @@ struct platform_device pxa27x_device_i2c_power = {
        .num_resources  = ARRAY_SIZE(i2c_power_resources),
 };
 
-void __init pxa_set_i2c_power_info(struct i2c_pxa_platform_data *info)
+void __init pxa27x_set_i2c_power_info(struct i2c_pxa_platform_data *info)
 {
        local_irq_disable();
        PCFR |= PCFR_PI2CEN;
@@ -357,7 +368,7 @@ void __init pxa_set_i2c_power_info(struct i2c_pxa_platform_data *info)
 }
 
 static struct platform_device *devices[] __initdata = {
-/*     &pxa_device_udc,        The UDC driver is PXA25x only */
+       &pxa27x_device_udc,
        &pxa_device_ffuart,
        &pxa_device_btuart,
        &pxa_device_stuart,
@@ -384,6 +395,9 @@ static int __init pxa27x_init(void)
        int i, ret = 0;
 
        if (cpu_is_pxa27x()) {
+
+               reset_status = RCSR;
+
                clks_register(pxa27x_clks, ARRAY_SIZE(pxa27x_clks));
 
                if ((ret = pxa_init_dma(32)))