git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.3
[linux-2.6.git]
/
arch
/
arm
/
mach-sa1100
/
pm.c
diff --git
a/arch/arm/mach-sa1100/pm.c
b/arch/arm/mach-sa1100/pm.c
index
2532b7f
..
7120ec5
100644
(file)
--- a/
arch/arm/mach-sa1100/pm.c
+++ b/
arch/arm/mach-sa1100/pm.c
@@
-30,6
+30,7
@@
#include <asm/hardware.h>
#include <asm/memory.h>
#include <asm/system.h>
#include <asm/hardware.h>
#include <asm/memory.h>
#include <asm/system.h>
+#include <asm/mach/time.h>
extern void sa1100_cpu_suspend(void);
extern void sa1100_cpu_resume(void);
extern void sa1100_cpu_suspend(void);
extern void sa1100_cpu_resume(void);
@@
-44,7
+45,7
@@
extern void sa1100_cpu_resume(void);
*/
enum { SLEEP_SAVE_SP = 0,
*/
enum { SLEEP_SAVE_SP = 0,
- SLEEP_SAVE_O
SCR, SLEEP_SAVE_O
IER,
+ SLEEP_SAVE_OIER,
SLEEP_SAVE_OSMR0, SLEEP_SAVE_OSMR1, SLEEP_SAVE_OSMR2, SLEEP_SAVE_OSMR3,
SLEEP_SAVE_GPDR, SLEEP_SAVE_GAFR,
SLEEP_SAVE_OSMR0, SLEEP_SAVE_OSMR1, SLEEP_SAVE_OSMR2, SLEEP_SAVE_OSMR3,
SLEEP_SAVE_GPDR, SLEEP_SAVE_GAFR,
@@
-58,18
+59,19
@@
enum { SLEEP_SAVE_SP = 0,
static int sa11x0_pm_enter(u32 state)
{
static int sa11x0_pm_enter(u32 state)
{
- unsigned long sleep_save[SLEEP_SAVE_SIZE];
-
unsigned long delta, gpio
;
+ unsigned long
gpio,
sleep_save[SLEEP_SAVE_SIZE];
+
struct timespec delta, rtc
;
if (state != PM_SUSPEND_MEM)
return -EINVAL;
/* preserve current time */
if (state != PM_SUSPEND_MEM)
return -EINVAL;
/* preserve current time */
- delta = xtime.tv_sec - RCNR;
+ rtc.tv_sec = RCNR;
+ rtc.tv_nsec = 0;
+ save_time_delta(&delta, &rtc);
gpio = GPLR;
/* save vital registers */
gpio = GPLR;
/* save vital registers */
- SAVE(OSCR);
SAVE(OSMR0);
SAVE(OSMR1);
SAVE(OSMR2);
SAVE(OSMR0);
SAVE(OSMR1);
SAVE(OSMR2);
@@
-131,11
+133,14
@@
static int sa11x0_pm_enter(u32 state)
RESTORE(OSMR1);
RESTORE(OSMR2);
RESTORE(OSMR3);
RESTORE(OSMR1);
RESTORE(OSMR2);
RESTORE(OSMR3);
- RESTORE(OSCR);
RESTORE(OIER);
RESTORE(OIER);
+ /* OSMR0 is the system timer: make sure OSCR is sufficiently behind */
+ OSCR = OSMR0 - LATCH;
+
/* restore current time */
/* restore current time */
- xtime.tv_sec = RCNR + delta;
+ rtc.tv_sec = RCNR;
+ restore_time_delta(&delta, &rtc);
return 0;
}
return 0;
}