diff options
Diffstat (limited to 'arch/arm/mach-omap1/time.c')
-rw-r--r-- | arch/arm/mach-omap1/time.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c index 237651ebae5d..a4f8b2055437 100644 --- a/arch/arm/mach-omap1/time.c +++ b/arch/arm/mach-omap1/time.c | |||
@@ -132,13 +132,20 @@ static inline void omap_mpu_timer_start(int nr, unsigned long load_val, | |||
132 | timer->cntl = timerflags; | 132 | timer->cntl = timerflags; |
133 | } | 133 | } |
134 | 134 | ||
135 | static inline void omap_mpu_timer_stop(int nr) | ||
136 | { | ||
137 | volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr); | ||
138 | |||
139 | timer->cntl &= ~MPU_TIMER_ST; | ||
140 | } | ||
141 | |||
135 | /* | 142 | /* |
136 | * --------------------------------------------------------------------------- | 143 | * --------------------------------------------------------------------------- |
137 | * MPU timer 1 ... count down to zero, interrupt, reload | 144 | * MPU timer 1 ... count down to zero, interrupt, reload |
138 | * --------------------------------------------------------------------------- | 145 | * --------------------------------------------------------------------------- |
139 | */ | 146 | */ |
140 | static int omap_mpu_set_next_event(unsigned long cycles, | 147 | static int omap_mpu_set_next_event(unsigned long cycles, |
141 | struct clock_event_device *evt) | 148 | struct clock_event_device *evt) |
142 | { | 149 | { |
143 | omap_mpu_timer_start(0, cycles, 0); | 150 | omap_mpu_timer_start(0, cycles, 0); |
144 | return 0; | 151 | return 0; |
@@ -152,6 +159,7 @@ static void omap_mpu_set_mode(enum clock_event_mode mode, | |||
152 | omap_mpu_set_autoreset(0); | 159 | omap_mpu_set_autoreset(0); |
153 | break; | 160 | break; |
154 | case CLOCK_EVT_MODE_ONESHOT: | 161 | case CLOCK_EVT_MODE_ONESHOT: |
162 | omap_mpu_timer_stop(0); | ||
155 | omap_mpu_remove_autoreset(0); | 163 | omap_mpu_remove_autoreset(0); |
156 | break; | 164 | break; |
157 | case CLOCK_EVT_MODE_UNUSED: | 165 | case CLOCK_EVT_MODE_UNUSED: |
@@ -163,7 +171,7 @@ static void omap_mpu_set_mode(enum clock_event_mode mode, | |||
163 | 171 | ||
164 | static struct clock_event_device clockevent_mpu_timer1 = { | 172 | static struct clock_event_device clockevent_mpu_timer1 = { |
165 | .name = "mpu_timer1", | 173 | .name = "mpu_timer1", |
166 | .features = CLOCK_EVT_FEAT_PERIODIC, CLOCK_EVT_FEAT_ONESHOT, | 174 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, |
167 | .shift = 32, | 175 | .shift = 32, |
168 | .set_next_event = omap_mpu_set_next_event, | 176 | .set_next_event = omap_mpu_set_next_event, |
169 | .set_mode = omap_mpu_set_mode, | 177 | .set_mode = omap_mpu_set_mode, |