Commit 51112776 authored by Tony Lindgren's avatar Tony Lindgren

ARM: OMAP: Make dyntick work again

Add set_next_event() and let the clock event code take care of
the rest.

Note that we're still reprogramming timer in periodic mode,
but this is OK as in the worst case we'll just get another
interrupt before timer is programmed again.
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 2110060d
...@@ -146,6 +146,14 @@ static inline void omap_32k_timer_ack_irq(void) ...@@ -146,6 +146,14 @@ static inline void omap_32k_timer_ack_irq(void)
#endif #endif
static int omap_32k_timer_set_next_event(unsigned long delta,
struct clock_event_device *dev)
{
omap_32k_timer_start(delta);
return 0;
}
static void omap_32k_timer_set_mode(enum clock_event_mode mode, static void omap_32k_timer_set_mode(enum clock_event_mode mode,
struct clock_event_device *evt) struct clock_event_device *evt)
{ {
...@@ -153,9 +161,9 @@ static void omap_32k_timer_set_mode(enum clock_event_mode mode, ...@@ -153,9 +161,9 @@ static void omap_32k_timer_set_mode(enum clock_event_mode mode,
switch (mode) { switch (mode) {
case CLOCK_EVT_MODE_PERIODIC: case CLOCK_EVT_MODE_PERIODIC:
case CLOCK_EVT_MODE_ONESHOT:
omap_32k_timer_start(OMAP_32K_TIMER_TICK_PERIOD); omap_32k_timer_start(OMAP_32K_TIMER_TICK_PERIOD);
break; break;
case CLOCK_EVT_MODE_ONESHOT:
case CLOCK_EVT_MODE_UNUSED: case CLOCK_EVT_MODE_UNUSED:
case CLOCK_EVT_MODE_SHUTDOWN: case CLOCK_EVT_MODE_SHUTDOWN:
break; break;
...@@ -166,8 +174,9 @@ static void omap_32k_timer_set_mode(enum clock_event_mode mode, ...@@ -166,8 +174,9 @@ static void omap_32k_timer_set_mode(enum clock_event_mode mode,
static struct clock_event_device clockevent_32k_timer = { static struct clock_event_device clockevent_32k_timer = {
.name = "32k-timer", .name = "32k-timer",
.features = CLOCK_EVT_FEAT_PERIODIC, .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
.shift = 32, .shift = 32,
.set_next_event = omap_32k_timer_set_next_event,
.set_mode = omap_32k_timer_set_mode, .set_mode = omap_32k_timer_set_mode,
}; };
......
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