OMAP: timekeeping: time should not stop during suspend
authorKevin Hilman <khilman@deeprootsystems.com>
Thu, 24 Sep 2009 23:35:48 +0000 (16:35 -0700)
committerKevin Hilman <khilman@deeprootsystems.com>
Thu, 21 Jan 2010 02:16:08 +0000 (18:16 -0800)
commitd92cfcbe39fdb2328a28b5505f31cb8be40fc339
tree709d6537fae858fb700aa83884eec2080a11b0bf
parentdccaad895094a699c37c065bff3fa9bb997daeb9
OMAP: timekeeping: time should not stop during suspend

During suspend, the kernel timekeeping subsystem is shut down.  Before
suspend and upon resume, it uses a weak function
read_persistent_clock() to determine the amount of time that elapsed
during suspend.

This function was not implemented on OMAP, so from the timekeeping
subsystem perspective (and thus userspace as well) it appeared that no
time elapsed during suspend.

This patch uses the 32k sync timer as a the persistent clock.

NOTE: This does *NOT* fully handle wrapping of the 32k sync timer, so
      more than one wrapping of the 32k sync timer during suspend may
      cause problems.  Also note there are not interrupts when the 32k
      sync timer wraps, so something else has to be done.

Reported-by: Jon Hunter <jon-hunter@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
arch/arm/plat-omap/common.c