Skip to content

Commit

Permalink
cris/time: Migrate to new 'set-state' interface
Browse files Browse the repository at this point in the history
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: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
  • Loading branch information
Viresh Kumar authored and Daniel Lezcano committed Aug 10, 2015
1 parent ecbebcb commit 2b5cf54
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions arch/cris/arch-v32/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,15 @@ void handle_watchdog_bite(struct pt_regs *regs)
extern void cris_profile_sample(struct pt_regs *regs);
static void __iomem *timer_base;

static void crisv32_clkevt_mode(enum clock_event_mode mode,
struct clock_event_device *dev)
static int crisv32_clkevt_switch_state(struct clock_event_device *dev)
{
reg_timer_rw_tmr0_ctrl ctrl = {
.op = regk_timer_hold,
.freq = regk_timer_f100,
};

REG_WR(timer, timer_base, rw_tmr0_ctrl, ctrl);
return 0;
}

static int crisv32_clkevt_next_event(unsigned long evt,
Expand Down Expand Up @@ -231,7 +231,9 @@ static struct clock_event_device crisv32_clockevent = {
.name = "crisv32-timer",
.rating = 300,
.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,
};

Expand Down

0 comments on commit 2b5cf54

Please sign in to comment.