]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-omap1/time.c
ARM: OMAP: Remove MPU-timer based sched_clock()
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap1 / time.c
index 237651ebae5da555be9e346b36f154400d9acaa7..c189a2d634e50cbe71dd45a7a7e28e8621e0058a 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,6 +159,7 @@ 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:
@@ -163,7 +171,7 @@ static void omap_mpu_set_mode(enum clock_event_mode mode,
 
 static struct clock_event_device clockevent_mpu_timer1 = {
        .name           = "mpu_timer1",
-       .features       = CLOCK_EVT_FEAT_PERIODIC, CLOCK_EVT_FEAT_ONESHOT,
+       .features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
        .shift          = 32,
        .set_next_event = omap_mpu_set_next_event,
        .set_mode       = omap_mpu_set_mode,
@@ -252,22 +260,6 @@ static void __init omap_init_clocksource(unsigned long rate)
                printk(err, clocksource_mpu.name);
 }
 
-
-/*
- * Scheduler clock - returns current time in nanosec units.
- */
-unsigned long long sched_clock(void)
-{
-       unsigned long ticks = 0 - omap_mpu_timer_read(1);
-       unsigned long long ticks64;
-
-       ticks64 = omap_mpu_timer2_overflows;
-       ticks64 <<= 32;
-       ticks64 |= ticks;
-
-       return cycles_2_ns(ticks64);
-}
-
 /*
  * ---------------------------------------------------------------------------
  * Timer initialization