Skip to content

Commit

Permalink
clocksource: sh_tmu: Use clockevents_config_and_register().
Browse files Browse the repository at this point in the history
This switches over to the now exported clockevents_config() and
clockevents_config_and_register() helpers. This knocks off a
long-standing TMU TODO item.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed Jun 11, 2012
1 parent c2225a5 commit 3977407
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions drivers/clocksource/sh_tmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,7 @@ static void sh_tmu_clock_event_start(struct sh_tmu_priv *p, int periodic)

sh_tmu_enable(p);

/* TODO: calculate good shift from rate and counter bit width */

ced->shift = 32;
ced->mult = div_sc(p->rate, NSEC_PER_SEC, ced->shift);
ced->max_delta_ns = clockevent_delta2ns(0xffffffff, ced);
ced->min_delta_ns = 5000;
clockevents_config(ced, p->rate);

if (periodic) {
p->periodic = (p->rate + HZ/2) / HZ;
Expand Down Expand Up @@ -323,7 +318,8 @@ static void sh_tmu_register_clockevent(struct sh_tmu_priv *p,
ced->set_mode = sh_tmu_clock_event_mode;

dev_info(&p->pdev->dev, "used for clock events\n");
clockevents_register_device(ced);

clockevents_config_and_register(ced, 1, 0x300, 0xffffffff);

ret = setup_irq(p->irqaction.irq, &p->irqaction);
if (ret) {
Expand Down

0 comments on commit 3977407

Please sign in to comment.