Skip to content

Commit

Permalink
ARM: ep93xx/timer: Migrate to new 'set-state' interface
Browse files Browse the repository at this point in the history
Migrate EP93xx 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.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
  • Loading branch information
Viresh Kumar authored and Olof Johansson committed Aug 13, 2015
1 parent 4f2f1f7 commit a54868b
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions arch/arm/mach-ep93xx/timer-ep93xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,22 @@ static int ep93xx_clkevt_set_next_event(unsigned long next,
}


static void ep93xx_clkevt_set_mode(enum clock_event_mode mode,
struct clock_event_device *evt)
static int ep93xx_clkevt_shutdown(struct clock_event_device *evt)
{
/* Disable timer */
writel(0, EP93XX_TIMER3_CONTROL);

return 0;
}

static struct clock_event_device ep93xx_clockevent = {
.name = "timer1",
.features = CLOCK_EVT_FEAT_ONESHOT,
.set_mode = ep93xx_clkevt_set_mode,
.set_next_event = ep93xx_clkevt_set_next_event,
.rating = 300,
.name = "timer1",
.features = CLOCK_EVT_FEAT_ONESHOT,
.set_state_shutdown = ep93xx_clkevt_shutdown,
.set_state_oneshot = ep93xx_clkevt_shutdown,
.tick_resume = ep93xx_clkevt_shutdown,
.set_next_event = ep93xx_clkevt_set_next_event,
.rating = 300,
};

static irqreturn_t ep93xx_timer_interrupt(int irq, void *dev_id)
Expand Down

0 comments on commit a54868b

Please sign in to comment.