aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/plat-omap/common.c')
-rw-r--r--arch/arm/plat-omap/common.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index 4f0f9c4e938e..7f1cae16cfad 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -193,6 +193,23 @@ static struct clocksource clocksource_32k = {
193 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 193 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
194}; 194};
195 195
196/*
197 * Rounds down to nearest nsec.
198 */
199unsigned long long omap_32k_ticks_to_nsecs(unsigned long ticks_32k)
200{
201 return cyc2ns(&clocksource_32k, ticks_32k);
202}
203
204/*
205 * Returns current time from boot in nsecs. It's OK for this to wrap
206 * around for now, as it's just a relative time stamp.
207 */
208unsigned long long sched_clock(void)
209{
210 return omap_32k_ticks_to_nsecs(omap_32k_read());
211}
212
196static int __init omap_init_clocksource_32k(void) 213static int __init omap_init_clocksource_32k(void)
197{ 214{
198 static char err[] __initdata = KERN_ERR 215 static char err[] __initdata = KERN_ERR