diff options
author | Sugaya Taichi <sugaya.taichi@socionext.com> | 2019-04-12 16:36:50 +0900 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2019-05-02 21:55:58 +0200 |
commit | 95d5dc712634901e6707d3178e6170aa6e0a43ce (patch) | |
tree | f407286139bfa56f38dc47fb98fe71491be05028 | |
parent | f0b1ca623d8df5dad977f22a1142a81a886b0eb8 (diff) |
clocksource/drivers/timer-milbeaut: Add shutdown function
Add a shutdown operation to support shutdown timer.
Signed-off-by: Sugaya Taichi <sugaya.taichi@socionext.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
-rw-r--r-- | drivers/clocksource/timer-milbeaut.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/clocksource/timer-milbeaut.c b/drivers/clocksource/timer-milbeaut.c index 9fd5d081fac4..f4780619dbaf 100644 --- a/drivers/clocksource/timer-milbeaut.c +++ b/drivers/clocksource/timer-milbeaut.c @@ -85,6 +85,15 @@ static int mlb_set_state_oneshot(struct clock_event_device *clk) return 0; } +static int mlb_set_state_shutdown(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); + return 0; +} + static int mlb_clkevt_next_event(unsigned long event, struct clock_event_device *clk) { @@ -125,6 +134,7 @@ static struct timer_of to = { .features = CLOCK_EVT_FEAT_DYNIRQ | CLOCK_EVT_FEAT_ONESHOT, .set_state_oneshot = mlb_set_state_oneshot, .set_state_periodic = mlb_set_state_periodic, + .set_state_shutdown = mlb_set_state_shutdown, .set_next_event = mlb_clkevt_next_event, }, |