This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / arch / arm / mach-pxa / pm.c
index 901ee68..5e84864 100644 (file)
@@ -47,6 +47,9 @@ extern void pxa_cpu_resume(void);
  */
 enum { SLEEP_SAVE_START = 0,
 
+       SLEEP_SAVE_OIER,
+       SLEEP_SAVE_OSMR0, SLEEP_SAVE_OSMR1, SLEEP_SAVE_OSMR2, SLEEP_SAVE_OSMR3,
+
        SLEEP_SAVE_GPLR0, SLEEP_SAVE_GPLR1, SLEEP_SAVE_GPLR2,
        SLEEP_SAVE_GPDR0, SLEEP_SAVE_GPDR1, SLEEP_SAVE_GPDR2,
        SLEEP_SAVE_GRER0, SLEEP_SAVE_GRER1, SLEEP_SAVE_GRER2,
@@ -63,7 +66,7 @@ enum {        SLEEP_SAVE_START = 0,
 };
 
 
-static int pxa_pm_enter(suspend_state_t state)
+static int pxa_pm_enter(u32 state)
 {
        unsigned long sleep_save[SLEEP_SAVE_SIZE];
        unsigned long checksum = 0;
@@ -78,6 +81,13 @@ static int pxa_pm_enter(suspend_state_t state)
        rtc.tv_nsec = 0;
        save_time_delta(&delta, &rtc);
 
+       /* save vital registers */
+       SAVE(OSMR0);
+       SAVE(OSMR1);
+       SAVE(OSMR2);
+       SAVE(OSMR3);
+       SAVE(OIER);
+
        SAVE(GPLR0); SAVE(GPLR1); SAVE(GPLR2);
        SAVE(GPDR0); SAVE(GPDR1); SAVE(GPDR2);
        SAVE(GRER0); SAVE(GRER1); SAVE(GRER2);
@@ -138,6 +148,15 @@ static int pxa_pm_enter(suspend_state_t state)
 
        PSSR = PSSR_RDH | PSSR_PH;
 
+       RESTORE(OSMR0);
+       RESTORE(OSMR1);
+       RESTORE(OSMR2);
+       RESTORE(OSMR3);
+       RESTORE(OIER);
+
+       /* OSMR0 is the system timer: make sure OSCR is sufficiently behind */
+       OSCR = OSMR0 - LATCH;
+
        RESTORE(CKEN);
 
        ICLR = 0;
@@ -163,7 +182,7 @@ unsigned long sleep_phys_sp(void *sp)
 /*
  * Called after processes are frozen, but before we shut down devices.
  */
-static int pxa_pm_prepare(suspend_state_t state)
+static int pxa_pm_prepare(u32 state)
 {
        return 0;
 }
@@ -171,7 +190,7 @@ static int pxa_pm_prepare(suspend_state_t state)
 /*
  * Called after devices are re-setup, but before processes are thawed.
  */
-static int pxa_pm_finish(suspend_state_t state)
+static int pxa_pm_finish(u32 state)
 {
        return 0;
 }