diff options
Diffstat (limited to 'arch/arm/plat-omap/dmtimer.c')
-rw-r--r-- | arch/arm/plat-omap/dmtimer.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c index af3b92be8459..0b77fe87e010 100644 --- a/arch/arm/plat-omap/dmtimer.c +++ b/arch/arm/plat-omap/dmtimer.c | |||
@@ -80,9 +80,9 @@ static void omap_dm_timer_write_reg(struct omap_dm_timer *timer, u32 reg, | |||
80 | 80 | ||
81 | static void omap_timer_restore_context(struct omap_dm_timer *timer) | 81 | static void omap_timer_restore_context(struct omap_dm_timer *timer) |
82 | { | 82 | { |
83 | omap_dm_timer_write_reg(timer, OMAP_TIMER_OCP_CFG_OFFSET, | 83 | __raw_writel(timer->context.tiocp_cfg, |
84 | timer->context.tiocp_cfg); | 84 | timer->io_base + OMAP_TIMER_OCP_CFG_OFFSET); |
85 | if (timer->revision > 1) | 85 | if (timer->revision == 1) |
86 | __raw_writel(timer->context.tistat, timer->sys_stat); | 86 | __raw_writel(timer->context.tistat, timer->sys_stat); |
87 | 87 | ||
88 | __raw_writel(timer->context.tisr, timer->irq_stat); | 88 | __raw_writel(timer->context.tisr, timer->irq_stat); |
@@ -357,6 +357,19 @@ int omap_dm_timer_stop(struct omap_dm_timer *timer) | |||
357 | 357 | ||
358 | __omap_dm_timer_stop(timer, timer->posted, rate); | 358 | __omap_dm_timer_stop(timer, timer->posted, rate); |
359 | 359 | ||
360 | if (timer->loses_context && timer->get_context_loss_count) | ||
361 | timer->ctx_loss_count = | ||
362 | timer->get_context_loss_count(&timer->pdev->dev); | ||
363 | |||
364 | /* | ||
365 | * Since the register values are computed and written within | ||
366 | * __omap_dm_timer_stop, we need to use read to retrieve the | ||
367 | * context. | ||
368 | */ | ||
369 | timer->context.tclr = | ||
370 | omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG); | ||
371 | timer->context.tisr = __raw_readl(timer->irq_stat); | ||
372 | omap_dm_timer_disable(timer); | ||
360 | return 0; | 373 | return 0; |
361 | } | 374 | } |
362 | EXPORT_SYMBOL_GPL(omap_dm_timer_stop); | 375 | EXPORT_SYMBOL_GPL(omap_dm_timer_stop); |