clocksource: dw_apb_timer: use the eoi callback to clear pending interrupts

A patch from »clocksource: dw_apb_timer: support for timer variant used in rk3188 SoCs« in state Obsolete for linux-kernel

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

---------------------- drivers/clocksource/dw_apb_timer.c ----------------------
index bd45351..5f80a30 100644
@@ -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);
}
/**
 
 

Recent Patches

About Us

Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum vel, tempor at, varius non, purus. Mauris vitae nisl nec metus placerat consectetuer.

Read More...