diff options
author | Kevin Hilman <khilman@mvista.com> | 2007-11-13 08:24:03 +0100 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2008-04-14 18:57:12 +0200 |
commit | f258b0c6fa6ca653c7f4e6e2846dbb7ed3af3446 (patch) | |
tree | a5c89a4c4506ca87f99d4fd155633296302d0215 /arch/arm/plat-omap/timer32k.c | |
parent | ARM: OMAP: Timer32K: Re-organize duplicated 32k-timer code (diff) | |
download | linux-f258b0c6fa6ca653c7f4e6e2846dbb7ed3af3446.tar.xz linux-f258b0c6fa6ca653c7f4e6e2846dbb7ed3af3446.zip |
ARM: OMAP: Timer32K: Move 32k-based sched_clock() to common code
Since 32k timer code is moving to OMAP1 specific dir, move the
32k-based sched_clock() into common code where it is based on the 32k
sync counter and can be used even when using MPU timer.
While moving, change the ticks-to-nsecs conversion to use the helper
functions provided by clocksource.h.
Also removed the unused ticks_to_usec, leaving only ticks_to_nsec.
Signed-off-by: Kevin Hilman <khilman@mvista.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to '')
-rw-r--r-- | arch/arm/plat-omap/timer32k.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/arch/arm/plat-omap/timer32k.c b/arch/arm/plat-omap/timer32k.c index ce034dc59d41..1f7365f5df24 100644 --- a/arch/arm/plat-omap/timer32k.c +++ b/arch/arm/plat-omap/timer32k.c @@ -153,32 +153,6 @@ static inline unsigned long omap_32k_sync_timer_read(void) return omap_readl(TIMER_32K_SYNCHRONIZED); } -/* - * Rounds down to nearest usec. Note that this will overflow for larger values. - */ -static inline unsigned long omap_32k_ticks_to_usecs(unsigned long ticks_32k) -{ - return (ticks_32k * 5*5*5*5*5*5) >> 9; -} - -/* - * Rounds down to nearest nsec. - */ -static inline unsigned long long -omap_32k_ticks_to_nsecs(unsigned long ticks_32k) -{ - return (unsigned long long) ticks_32k * 1000 * 5*5*5*5*5*5 >> 9; -} - -/* - * Returns current time from boot in nsecs. It's OK for this to wrap - * around for now, as it's just a relative time stamp. - */ -unsigned long long sched_clock(void) -{ - return omap_32k_ticks_to_nsecs(omap_32k_sync_timer_read()); -} - static irqreturn_t omap_32k_timer_interrupt(int irq, void *dev_id) { struct clock_event_device *evt = &clockevent_32k_timer; |