diff mbox series

[04/15] clocksource/drivers/timer-milbeaut: Fix to enable one-shot timer

Message ID 20190509111048.11151-4-daniel.lezcano@linaro.org
State Accepted
Commit f0b1ca623d8df5dad977f22a1142a81a886b0eb8
Headers show
Series [01/15] clocksource/drivers/sun4i: Add a compatible for suniv | expand

Commit Message

Daniel Lezcano May 9, 2019, 11:10 a.m. UTC
From: Sugaya Taichi <sugaya.taichi@socionext.com>


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 | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.17.1
diff mbox series

Patch

diff --git a/drivers/clocksource/timer-milbeaut.c b/drivers/clocksource/timer-milbeaut.c
index f2019a88e3ee..9fd5d081fac4 100644
--- a/drivers/clocksource/timer-milbeaut.c
+++ b/drivers/clocksource/timer-milbeaut.c
@@ -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;
 }