ARM: tegra: timer: Fix us timer time after resume from LP1
authorColin Cross <ccross@android.com>
Sun, 24 Oct 2010 23:11:03 +0000 (16:11 -0700)
committerColin Cross <ccross@android.com>
Tue, 26 Oct 2010 01:46:20 +0000 (18:46 -0700)
commit0ecadc39ae92523ede4100d93a7242d13565e8df
tree5192a726f132889fd2f86c9785df97cd9d56556f
parent683a9ff2dfd1a050f1b6db75e1b7955869a2e158
ARM: tegra: timer: Fix us timer time after resume from LP1

In LP1 suspend, or during a failed LP0 suspend, the core power is
not turned off and the timer register is not reset.  Saving the
timer value during suspend and adding it to the offset after resume
will cause the timer value to double for each suspend cycle.

To fix, when resuming subtract the current value of the timer
register from the offset.  Also, use the rtc registers to add
the time that passed during suspend.

Change-Id: I9f7ee2089b98cf66af45271f8478fbd9eb2ee250
Signed-off-by: Colin Cross <ccross@android.com>
arch/arm/mach-tegra/timer.c