Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 179769
b: refs/heads/master
c: d92cfcb
h: refs/heads/master
i:
  179767: f22d70e
v: v3
  • Loading branch information
Kevin Hilman committed Jan 21, 2010
1 parent 9805d9c commit 49c5b7b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dccaad895094a699c37c065bff3fa9bb997daeb9
refs/heads/master: d92cfcbe39fdb2328a28b5505f31cb8be40fc339
26 changes: 26 additions & 0 deletions trunk/arch/arm/plat-omap/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,32 @@ unsigned long long sched_clock(void)
clocksource_32k.mult, clocksource_32k.shift);
}

/**
* read_persistent_clock - Return time from a persistent clock.
*
* Reads the time from a source which isn't disabled during PM, the
* 32k sync timer. Convert the cycles elapsed since last read into
* nsecs and adds to a monotonically increasing timespec.
*/
static struct timespec persistent_ts;
static cycles_t cycles, last_cycles;
void read_persistent_clock(struct timespec *ts)
{
unsigned long long nsecs;
cycles_t delta;
struct timespec *tsp = &persistent_ts;

last_cycles = cycles;
cycles = clocksource_32k.read(&clocksource_32k);
delta = cycles - last_cycles;

nsecs = clocksource_cyc2ns(delta,
clocksource_32k.mult, clocksource_32k.shift);

timespec_add_ns(tsp, nsecs);
*ts = *tsp;
}

static int __init omap_init_clocksource_32k(void)
{
static char err[] __initdata = KERN_ERR
Expand Down

0 comments on commit 49c5b7b

Please sign in to comment.