@@ -258,6 +258,7 @@ static void mxc_set_mode(enum clock_event_mode mode,
struct clock_event_device *evt)
{
unsigned long flags;
+ struct imx_timer *tm = container_of(evt, struct imx_timer, evt);
/*
* The timer interrupt generation is disabled at least
@@ -266,19 +267,14 @@ static void mxc_set_mode(enum clock_event_mode mode,
local_irq_save(flags);
/* Disable interrupt in GPT module */
- gpt_irq_disable();
+ tm->gpt_irq_disable(tm);
if (mode != clockevent_mode) {
/* Set event time into far-far future */
- if (timer_is_v2())
- __raw_writel(__raw_readl(timer_base + V2_TCN) - 3,
- timer_base + V2_TCMP);
- else
- __raw_writel(__raw_readl(timer_base + MX1_2_TCN) - 3,
- timer_base + MX1_2_TCMP);
+ evt->set_next_event(-3, evt);
/* Clear pending interrupt */
- gpt_irq_acknowledge();
+ tm->gpt_irq_acknowledge(tm);
}
#ifdef DEBUG
@@ -304,7 +300,7 @@ static void mxc_set_mode(enum clock_event_mode mode,
* mode switching
*/
local_irq_save(flags);
- gpt_irq_enable();
+ tm->gpt_irq_enable(tm);
local_irq_restore(flags);
break;
case CLOCK_EVT_MODE_SHUTDOWN:
Enabled the use of parameter *evt, and removed the SoC relating codes in mxc_set_mode. Signed-off-by: Shenwei Wang <shenwei.wang@freescale.com> --- arch/arm/mach-imx/time.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)