]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-omap1/time.c
ARM: OMAP: Fix clockevent support for hrtimers
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap1 / time.c
index 85e048b259f57d92b6f2cb1fc9f77c6d95693ca6..572a2dbc72ab765ca3c4b2081071aaee9ddad420 100644 (file)
@@ -132,13 +132,20 @@ static inline void omap_mpu_timer_start(int nr, unsigned long load_val,
        timer->cntl = timerflags;
 }
 
+static inline void omap_mpu_timer_stop(int nr)
+{
+       volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr);
+
+       timer->cntl &= ~MPU_TIMER_ST;
+}
+
 /*
  * ---------------------------------------------------------------------------
  * MPU timer 1 ... count down to zero, interrupt, reload
  * ---------------------------------------------------------------------------
  */
 static int omap_mpu_set_next_event(unsigned long cycles,
-                                   struct clock_event_device *evt)
+                                  struct clock_event_device *evt)
 {
        omap_mpu_timer_start(0, cycles, 0);
        return 0;
@@ -152,10 +159,12 @@ static void omap_mpu_set_mode(enum clock_event_mode mode,
                omap_mpu_set_autoreset(0);
                break;
        case CLOCK_EVT_MODE_ONESHOT:
+               omap_mpu_timer_stop(0);
                omap_mpu_remove_autoreset(0);
                break;
        case CLOCK_EVT_MODE_UNUSED:
        case CLOCK_EVT_MODE_SHUTDOWN:
+       case CLOCK_EVT_MODE_RESUME:
                break;
        }
 }
@@ -179,7 +188,7 @@ static irqreturn_t omap_mpu_timer1_interrupt(int irq, void *dev_id)
 
 static struct irqaction omap_mpu_timer1_irq = {
        .name           = "mpu_timer1",
-       .flags          = IRQF_DISABLED | IRQF_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
        .handler        = omap_mpu_timer1_interrupt,
 };