[ARM] pxa: separate out power manager and clock registers
[deliverable/linux.git] / arch / arm / mach-pxa / pxa25x.c
index 599e53fcc2c5abb7b039269e506dd8d2d71aeaff..3b848dc3ca11506c4abb234897f8c94998cf7b10 100644 (file)
@@ -26,6 +26,8 @@
 #include <asm/hardware.h>
 #include <asm/arch/irqs.h>
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-regs.h>
+#include <asm/arch/mfp-pxa25x.h>
 #include <asm/arch/pm.h>
 #include <asm/arch/dma.h>
 
@@ -129,6 +131,8 @@ static struct clk pxa25x_clks[] = {
        INIT_CKEN("SSPCLK", NSSP, 3686400, 0, &pxa25x_device_nssp.dev),
        INIT_CKEN("SSPCLK", ASSP, 3686400, 0, &pxa25x_device_assp.dev),
 
+       INIT_CKEN("AC97CLK",     AC97,     24576000, 0, NULL),
+
        /*
        INIT_CKEN("PWMCLK",  PWM0, 3686400,  0, NULL),
        INIT_CKEN("PWMCLK",  PWM0, 3686400,  0, NULL),
@@ -147,9 +151,7 @@ static struct clk pxa25x_clks[] = {
  * More ones like CP and general purpose register values are preserved
  * with the stack pointer in sleep.S.
  */
-enum { SLEEP_SAVE_START = 0,
-
-       SLEEP_SAVE_PGSR0, SLEEP_SAVE_PGSR1, SLEEP_SAVE_PGSR2,
+enum { SLEEP_SAVE_PGSR0, SLEEP_SAVE_PGSR1, SLEEP_SAVE_PGSR2,
 
        SLEEP_SAVE_GAFR0_L, SLEEP_SAVE_GAFR0_U,
        SLEEP_SAVE_GAFR1_L, SLEEP_SAVE_GAFR1_U,
@@ -159,7 +161,7 @@ enum {      SLEEP_SAVE_START = 0,
 
        SLEEP_SAVE_CKEN,
 
-       SLEEP_SAVE_SIZE
+       SLEEP_SAVE_COUNT
 };
 
 
@@ -197,6 +199,9 @@ static void pxa25x_cpu_pm_restore(unsigned long *sleep_save)
 
 static void pxa25x_cpu_pm_enter(suspend_state_t state)
 {
+       /* Clear reset status */
+       RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
+
        switch (state) {
        case PM_SUSPEND_MEM:
                /* set resume return address */
@@ -207,7 +212,7 @@ static void pxa25x_cpu_pm_enter(suspend_state_t state)
 }
 
 static struct pxa_cpu_pm_fns pxa25x_cpu_pm_fns = {
-       .save_size      = SLEEP_SAVE_SIZE,
+       .save_count     = SLEEP_SAVE_COUNT,
        .valid          = suspend_valid_only_mem,
        .save           = pxa25x_cpu_pm_save,
        .restore        = pxa25x_cpu_pm_restore,
@@ -228,24 +233,10 @@ static inline void pxa25x_init_pm(void) {}
 static int pxa25x_set_wake(unsigned int irq, unsigned int on)
 {
        int gpio = IRQ_TO_GPIO(irq);
-       uint32_t gpio_bit, mask = 0;
-
-       if (gpio >= 0 && gpio <= 15) {
-               gpio_bit = GPIO_bit(gpio);
-               mask = gpio_bit;
-               if (on) {
-                       if (GRER(gpio) | gpio_bit)
-                               PRER |= gpio_bit;
-                       else
-                               PRER &= ~gpio_bit;
-
-                       if (GFER(gpio) | gpio_bit)
-                               PFER |= gpio_bit;
-                       else
-                               PFER &= ~gpio_bit;
-               }
-               goto set_pwer;
-       }
+       uint32_t mask = 0;
+
+       if (gpio >= 0 && gpio < 85)
+               return gpio_set_wake(gpio, on);
 
        if (irq == IRQ_RTCAlrm) {
                mask = PWER_RTC;
@@ -265,9 +256,8 @@ set_pwer:
 
 void __init pxa25x_init_irq(void)
 {
-       pxa_init_irq_low();
-       pxa_init_irq_gpio(85);
-       pxa_init_irq_set_wake(pxa25x_set_wake);
+       pxa_init_irq(32, pxa25x_set_wake);
+       pxa_init_gpio(85, pxa25x_set_wake);
 }
 
 static struct platform_device *pxa25x_devices[] __initdata = {
@@ -325,4 +315,4 @@ static int __init pxa25x_init(void)
        return ret;
 }
 
-subsys_initcall(pxa25x_init);
+postcore_initcall(pxa25x_init);
This page took 0.025542 seconds and 5 git commands to generate.