X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Farm%2Fmach-pxa%2Fpm.c;h=901ee6880016c8d0d88cf751af0d479c8f6e2650;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=245e25b08f2f83449621fa9abe4a4165e8614fdd;hpb=9213980e6a70d8473e0ffd4b39ab5b6caaba9ff5;p=linux-2.6.git diff --git a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c index 245e25b08..901ee6880 100644 --- a/arch/arm/mach-pxa/pm.c +++ b/arch/arm/mach-pxa/pm.c @@ -19,7 +19,9 @@ #include #include #include +#include #include +#include /* @@ -45,9 +47,6 @@ extern void pxa_cpu_resume(void); */ enum { SLEEP_SAVE_START = 0, - SLEEP_SAVE_OSCR, 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, @@ -64,26 +63,20 @@ enum { SLEEP_SAVE_START = 0, }; -static int pxa_pm_enter(u32 state) +static int pxa_pm_enter(suspend_state_t state) { unsigned long sleep_save[SLEEP_SAVE_SIZE]; unsigned long checksum = 0; - unsigned long delta; + struct timespec delta, rtc; int i; if (state != PM_SUSPEND_MEM) return -EINVAL; /* preserve current time */ - delta = xtime.tv_sec - RCNR; - - /* save vital registers */ - SAVE(OSCR); - SAVE(OSMR0); - SAVE(OSMR1); - SAVE(OSMR2); - SAVE(OSMR3); - SAVE(OIER); + rtc.tv_sec = RCNR; + rtc.tv_nsec = 0; + save_time_delta(&delta, &rtc); SAVE(GPLR0); SAVE(GPLR1); SAVE(GPLR2); SAVE(GPDR0); SAVE(GPDR1); SAVE(GPDR2); @@ -145,13 +138,6 @@ static int pxa_pm_enter(u32 state) PSSR = PSSR_RDH | PSSR_PH; - RESTORE(OSMR0); - RESTORE(OSMR1); - RESTORE(OSMR2); - RESTORE(OSMR3); - RESTORE(OSCR); - RESTORE(OIER); - RESTORE(CKEN); ICLR = 0; @@ -159,7 +145,8 @@ static int pxa_pm_enter(u32 state) RESTORE(ICMR); /* restore current time */ - xtime.tv_sec = RCNR + delta; + rtc.tv_sec = RCNR; + restore_time_delta(&delta, &rtc); #ifdef DEBUG printk(KERN_DEBUG "*** made it back from resume\n"); @@ -176,7 +163,7 @@ unsigned long sleep_phys_sp(void *sp) /* * Called after processes are frozen, but before we shut down devices. */ -static int pxa_pm_prepare(u32 state) +static int pxa_pm_prepare(suspend_state_t state) { return 0; } @@ -184,7 +171,7 @@ static int pxa_pm_prepare(u32 state) /* * Called after devices are re-setup, but before processes are thawed. */ -static int pxa_pm_finish(u32 state) +static int pxa_pm_finish(suspend_state_t state) { return 0; }