diff options
Diffstat (limited to 'arch/arm/plat-omap/timer32k.c')
-rw-r--r-- | arch/arm/plat-omap/timer32k.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/arm/plat-omap/timer32k.c b/arch/arm/plat-omap/timer32k.c index 281ecc7fcdfc..f7b4e89de518 100644 --- a/arch/arm/plat-omap/timer32k.c +++ b/arch/arm/plat-omap/timer32k.c | |||
@@ -105,6 +105,8 @@ static inline unsigned long omap_32k_timer_read(int reg) | |||
105 | 105 | ||
106 | static inline void omap_32k_timer_start(unsigned long load_val) | 106 | static inline void omap_32k_timer_start(unsigned long load_val) |
107 | { | 107 | { |
108 | if (!load_val) | ||
109 | load_val = 1; | ||
108 | omap_32k_timer_write(load_val, OMAP1_32K_TIMER_TVR); | 110 | omap_32k_timer_write(load_val, OMAP1_32K_TIMER_TVR); |
109 | omap_32k_timer_write(0x0f, OMAP1_32K_TIMER_CR); | 111 | omap_32k_timer_write(0x0f, OMAP1_32K_TIMER_CR); |
110 | } | 112 | } |
@@ -230,7 +232,15 @@ static irqreturn_t omap_32k_timer_interrupt(int irq, void *dev_id, | |||
230 | */ | 232 | */ |
231 | void omap_32k_timer_reprogram(unsigned long next_tick) | 233 | void omap_32k_timer_reprogram(unsigned long next_tick) |
232 | { | 234 | { |
233 | omap_32k_timer_start(JIFFIES_TO_HW_TICKS(next_tick, 32768) + 1); | 235 | unsigned long ticks = JIFFIES_TO_HW_TICKS(next_tick, 32768) + 1; |
236 | unsigned long now = omap_32k_sync_timer_read(); | ||
237 | unsigned long idled = now - omap_32k_last_tick; | ||
238 | |||
239 | if (idled + 1 < ticks) | ||
240 | ticks -= idled; | ||
241 | else | ||
242 | ticks = 1; | ||
243 | omap_32k_timer_start(ticks); | ||
234 | } | 244 | } |
235 | 245 | ||
236 | static struct irqaction omap_32k_timer_irq; | 246 | static struct irqaction omap_32k_timer_irq; |