summaryrefslogtreecommitdiff
path: root/arch/sh/kernel/timers
diff options
context:
space:
mode:
authorMagnus Damm <damm@igel.co.jp>2009-01-22 09:55:31 (GMT)
committerPaul Mundt <lethal@linux-sh.org>2009-01-29 07:44:17 (GMT)
commit955c0778723501cc16fec40501cd54b7e72d3e74 (patch)
tree5e97004d7d5e3cb990e385beb045664e26f20a48 /arch/sh/kernel/timers
parentdc66ff6220f0a6c938df41add526d645852d9a75 (diff)
downloadlinux-fsl-qoriq-955c0778723501cc16fec40501cd54b7e72d3e74.tar.xz
sh: rework clocksource and sched_clock
Rework and simplify the sched_clock and clocksource code. Instead of registering the clocksource in a shared file we move it into the tmu driver. Also, add code to handle sched_clock in the case of no clocksource. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/timers')
-rw-r--r--arch/sh/kernel/timers/timer-tmu.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/sh/kernel/timers/timer-tmu.c b/arch/sh/kernel/timers/timer-tmu.c
index 0db3f95..33a24fc 100644
--- a/arch/sh/kernel/timers/timer-tmu.c
+++ b/arch/sh/kernel/timers/timer-tmu.c
@@ -254,7 +254,14 @@ static int tmu_timer_init(void)
_tmu_start(TMU1);
- sh_hpt_frequency = clk_get_rate(&tmu1_clk);
+ clocksource_sh.rating = 200;
+ clocksource_sh.mask = CLOCKSOURCE_MASK(32);
+ clocksource_sh.read = tmu_timer_read;
+ clocksource_sh.shift = 10;
+ clocksource_sh.mult = clocksource_hz2mult(clk_get_rate(&tmu1_clk),
+ clocksource_sh.shift);
+ clocksource_sh.flags = CLOCK_SOURCE_IS_CONTINUOUS;
+ clocksource_register(&clocksource_sh);
tmu0_clockevent.mult = div_sc(frequency, NSEC_PER_SEC,
tmu0_clockevent.shift);
@@ -274,7 +281,6 @@ static struct sys_timer_ops tmu_timer_ops = {
.init = tmu_timer_init,
.start = tmu_timer_start,
.stop = tmu_timer_stop,
- .read = tmu_timer_read,
};
struct sys_timer tmu_timer = {