clocksource: sh_tmu: Use clockevents_config_and_register().
authorPaul Mundt <lethal@linux-sh.org>
Mon, 11 Jun 2012 08:10:16 +0000 (17:10 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Mon, 11 Jun 2012 08:10:16 +0000 (17:10 +0900)
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>
drivers/clocksource/sh_tmu.c

index 852b3f1..c1b51d4 100644 (file)
@@ -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;
@@ -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) {