From: Ulrich Prinz <ulrich.prinz@...>
Date: Wed, 3 Jul 2013 15:25:22 +0200
Commit-Message
Some timer variants have different mechanisms to clear a pending timer
interrupt. Therefore don't hardcode the reading of the eoi register to
clear them, but instead use the already existing eoi callback for this.
Signed-off-by: Ulrich Prinz <ulrich.prinz@...>
Patch-Comment
drivers/clocksource/dw_apb_timer.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
Statistics
- 7 lines added
- 4 lines removed
Changes
@@ -121,11 +121,14 @@ static irqreturn_t dw_apb_clockevent_irq(int irq, void *data)
return IRQ_HANDLED;
}
-static void apbt_enable_int(struct dw_apb_timer *timer)
+static void apbt_enable_int(struct dw_apb_clock_event_device *dw_ced)
{
+ struct dw_apb_timer *timer = &dw_ced->timer;
unsigned long ctrl = apbt_readl(timer, timer->reg_control);
+
/* clear pending intr */
- apbt_readl(timer, timer->reg_eoi);
+ if (dw_ced->eoi)
+ dw_ced->eoi(timer);
ctrl &= ~APBTMR_CONTROL_INT;
apbt_writel(timer, ctrl, timer->reg_control);
}
@@ -200,7 +203,7 @@ static void apbt_set_mode(enum clock_event_mode mode,
break;
case CLOCK_EVT_MODE_RESUME:
- apbt_enable_int(timer);
+ apbt_enable_int(dw_ced);
break;
}
}
@@ -325,7 +328,7 @@ void dw_apb_clockevent_register(struct dw_apb_clock_event_device *dw_ced)
apbt_writel(timer, 0, timer->reg_control);
clockevents_register_device(&dw_ced->ced);
- apbt_enable_int(timer);
+ apbt_enable_int(dw_ced);
}
/**