aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/timer-gp.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2011-03-02 20:07:14 -0500
committerTony Lindgren <tony@atomide.com>2011-03-02 20:07:14 -0500
commit12d7d4e0ed8fecf7f74c89483b55b300be6e5901 (patch)
treef573761ac752ff04ec445e23aef50adadda49790 /arch/arm/mach-omap2/timer-gp.c
parentaca6ad073ea820776bf5bdb87cf82eace35042c8 (diff)
parent790ab7e92bec24aee3939b300d36b99ab2e3f3ca (diff)
Merge branch 'devel-cleanup' into omap-for-linus
Conflicts: arch/arm/mach-omap2/timer-gp.c
Diffstat (limited to 'arch/arm/mach-omap2/timer-gp.c')
-rw-r--r--arch/arm/mach-omap2/timer-gp.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c
index fb8d656e4d0a..3b9cf85f4bb9 100644
--- a/arch/arm/mach-omap2/timer-gp.c
+++ b/arch/arm/mach-omap2/timer-gp.c
@@ -39,6 +39,7 @@
39#include <asm/mach/time.h> 39#include <asm/mach/time.h>
40#include <plat/dmtimer.h> 40#include <plat/dmtimer.h>
41#include <asm/localtimer.h> 41#include <asm/localtimer.h>
42#include <asm/sched_clock.h>
42#include <plat/common.h> 43#include <plat/common.h>
43#include <plat/omap_hwmod.h> 44#include <plat/omap_hwmod.h>
44 45
@@ -195,6 +196,7 @@ static void __init omap2_gp_clocksource_init(void)
195/* 196/*
196 * clocksource 197 * clocksource
197 */ 198 */
199static DEFINE_CLOCK_DATA(cd);
198static struct omap_dm_timer *gpt_clocksource; 200static struct omap_dm_timer *gpt_clocksource;
199static cycle_t clocksource_read_cycles(struct clocksource *cs) 201static cycle_t clocksource_read_cycles(struct clocksource *cs)
200{ 202{
@@ -209,6 +211,15 @@ static struct clocksource clocksource_gpt = {
209 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 211 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
210}; 212};
211 213
214static void notrace dmtimer_update_sched_clock(void)
215{
216 u32 cyc;
217
218 cyc = omap_dm_timer_read_counter(gpt_clocksource);
219
220 update_sched_clock(&cd, cyc, (u32)~0);
221}
222
212/* Setup free-running counter for clocksource */ 223/* Setup free-running counter for clocksource */
213static void __init omap2_gp_clocksource_init(void) 224static void __init omap2_gp_clocksource_init(void)
214{ 225{
@@ -229,6 +240,8 @@ static void __init omap2_gp_clocksource_init(void)
229 240
230 omap_dm_timer_set_load_start(gpt, 1, 0); 241 omap_dm_timer_set_load_start(gpt, 1, 0);
231 242
243 init_sched_clock(&cd, dmtimer_update_sched_clock, 32, tick_rate);
244
232 if (clocksource_register_hz(&clocksource_gpt, tick_rate)) 245 if (clocksource_register_hz(&clocksource_gpt, tick_rate))
233 printk(err2, clocksource_gpt.name); 246 printk(err2, clocksource_gpt.name);
234} 247}