]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
clocksource/drivers/timer-milbeaut: Fix to enable one-shot timer
authorSugaya Taichi <sugaya.taichi@socionext.com>
Fri, 12 Apr 2019 07:36:49 +0000 (16:36 +0900)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Thu, 2 May 2019 19:55:58 +0000 (21:55 +0200)
Fix mlb_set_oneshot_state() to enable one-shot timer.
The function should stop and start a timer, but "start" statement was
dropped. Kick the register to start one-shot timer.

Fixes: b58f28f306db ("clocksource/drivers/timer-milbeaut: Introduce timer for Milbeaut SoCs")
Signed-off-by: Sugaya Taichi <sugaya.taichi@socionext.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/clocksource/timer-milbeaut.c

index f2019a88e3eef1ec2f11508e78f82dd0b85dbb06..9fd5d081fac48b2fa2e01e8534c0bcb95116cb53 100644 (file)
@@ -79,6 +79,8 @@ static int mlb_set_state_oneshot(struct clock_event_device *clk)
        struct timer_of *to = to_timer_of(clk);
        u32 val = MLB_TMR_TMCSR_CSL_DIV2;
 
+       writel_relaxed(val, timer_of_base(to) + MLB_TMR_EVT_TMCSR_OFS);
+       val |= MLB_TMR_TMCSR_CNTE | MLB_TMR_TMCSR_TRG | MLB_TMR_TMCSR_INTE;
        writel_relaxed(val, timer_of_base(to) + MLB_TMR_EVT_TMCSR_OFS);
        return 0;
 }