]> err.no Git - linux-2.6/blobdiff - arch/arm/mach-ns9xxx/irq.c
[ARM] 4493/1: ns9xxx: disable a non-reloading timer before ack'ing its irq
[linux-2.6] / arch / arm / mach-ns9xxx / irq.c
index 83d92724a971cb383c7141968148ddcccf3a9119..b8c7b00522e677d0ee8d5f0ebc72faa1a7ed9a98 100644 (file)
@@ -21,6 +21,15 @@ static void ns9xxx_ack_irq_timer(unsigned int irq)
 {
        u32 tc = SYS_TC(irq - IRQ_TIMER0);
 
+       /*
+        * If the timer is programmed to halt on terminal count, the
+        * timer must be disabled before clearing the interrupt.
+        */
+       if (REGGET(tc, SYS_TCx, REN) == 0) {
+               REGSET(tc, SYS_TCx, TEN, DIS);
+               SYS_TC(irq - IRQ_TIMER0) = tc;
+       }
+
        REGSET(tc, SYS_TCx, INTC, SET);
        SYS_TC(irq - IRQ_TIMER0) = tc;
 
@@ -28,7 +37,7 @@ static void ns9xxx_ack_irq_timer(unsigned int irq)
        SYS_TC(irq - IRQ_TIMER0) = tc;
 }
 
-void (*ns9xxx_ack_irq_functions[NR_IRQS])(unsigned int) = {
+static void (*ns9xxx_ack_irq_functions[NR_IRQS])(unsigned int) = {
        [IRQ_TIMER0] = ns9xxx_ack_irq_timer,
        [IRQ_TIMER1] = ns9xxx_ack_irq_timer,
        [IRQ_TIMER2] = ns9xxx_ack_irq_timer,