Commit 2b5cf544 authored by Viresh Kumar's avatar Viresh Kumar Committed by Daniel Lezcano

cris/time: Migrate to new 'set-state' interface

Migrate cris driver to the new 'set-state' interface provided by
clockevents core, the earlier 'set-mode' interface is marked obsolete
now.

This also enables us to implement callbacks for new states of clockevent
devices, for example: ONESHOT_STOPPED.

Cc: Mikael Starvik <starvik@axis.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Rabin Vincent <rabin@rab.in>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-cris-kernel@axis.com
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
parent ecbebcb8
...@@ -172,8 +172,7 @@ void handle_watchdog_bite(struct pt_regs *regs) ...@@ -172,8 +172,7 @@ void handle_watchdog_bite(struct pt_regs *regs)
extern void cris_profile_sample(struct pt_regs *regs); extern void cris_profile_sample(struct pt_regs *regs);
static void __iomem *timer_base; static void __iomem *timer_base;
static void crisv32_clkevt_mode(enum clock_event_mode mode, static int crisv32_clkevt_switch_state(struct clock_event_device *dev)
struct clock_event_device *dev)
{ {
reg_timer_rw_tmr0_ctrl ctrl = { reg_timer_rw_tmr0_ctrl ctrl = {
.op = regk_timer_hold, .op = regk_timer_hold,
...@@ -181,6 +180,7 @@ static void crisv32_clkevt_mode(enum clock_event_mode mode, ...@@ -181,6 +180,7 @@ static void crisv32_clkevt_mode(enum clock_event_mode mode,
}; };
REG_WR(timer, timer_base, rw_tmr0_ctrl, ctrl); REG_WR(timer, timer_base, rw_tmr0_ctrl, ctrl);
return 0;
} }
static int crisv32_clkevt_next_event(unsigned long evt, static int crisv32_clkevt_next_event(unsigned long evt,
...@@ -231,7 +231,9 @@ static struct clock_event_device crisv32_clockevent = { ...@@ -231,7 +231,9 @@ static struct clock_event_device crisv32_clockevent = {
.name = "crisv32-timer", .name = "crisv32-timer",
.rating = 300, .rating = 300,
.features = CLOCK_EVT_FEAT_ONESHOT, .features = CLOCK_EVT_FEAT_ONESHOT,
.set_mode = crisv32_clkevt_mode, .set_state_oneshot = crisv32_clkevt_switch_state,
.set_state_shutdown = crisv32_clkevt_switch_state,
.tick_resume = crisv32_clkevt_switch_state,
.set_next_event = crisv32_clkevt_next_event, .set_next_event = crisv32_clkevt_next_event,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment