fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / arch / arm / mach-lh7a40x / time.c
index 61ada24..bef3c4b 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  *  arch/arm/mach-lh7a40x/time.c
  *
  *  Copyright (C) 2004 Logic Product Development
@@ -8,10 +8,10 @@
  *  version 2 as published by the Free Software Foundation.
  *
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/time.h>
 
 #include <asm/hardware.h>
 #include <asm/leds.h>
 
 #include <asm/mach/time.h>
+#include "common.h"
 
 #if HZ < 100
-# define TIMER_CONTROL TIMER_CONTROL1
-# define TIMER_LOAD    TIMER_LOAD1
+# define TIMER_CONTROL TIMER_CONTROL2
+# define TIMER_LOAD    TIMER_LOAD2
 # define TIMER_CONSTANT        (508469/HZ)
 # define TIMER_MODE    (TIMER_C_ENABLE | TIMER_C_PERIODIC | TIMER_C_508KHZ)
-# define TIMER_EOI     TIMER_EOI1
-# define TIMER_IRQ     IRQ_T1UI
+# define TIMER_EOI     TIMER_EOI2
+# define TIMER_IRQ     IRQ_T2UI
 #else
 # define TIMER_CONTROL TIMER_CONTROL3
 # define TIMER_LOAD    TIMER_LOAD3
 #endif
 
 static irqreturn_t
-lh7a40x_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+lh7a40x_timer_interrupt(int irq, void *dev_id)
 {
+       write_seqlock(&xtime_lock);
+
        TIMER_EOI = 0;
-       timer_tick(regs);
+       timer_tick();
+
+       write_sequnlock(&xtime_lock);
 
        return IRQ_HANDLED;
 }
 
 static struct irqaction lh7a40x_timer_irq = {
        .name           = "LHA740x Timer Tick",
-       .flags          = SA_INTERRUPT,
-       .handler        = lh7a40x_timer_interrupt
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
+       .handler        = lh7a40x_timer_interrupt,
 };
 
-void __init lh7a40x_init_time(void)
+static void __init lh7a40x_timer_init (void)
 {
                                /* Stop/disable all timers */
        TIMER_CONTROL1 = 0;
@@ -65,3 +70,6 @@ void __init lh7a40x_init_time(void)
        TIMER_CONTROL = TIMER_MODE;
 }
 
+struct sys_timer lh7a40x_timer = {
+       .init           = &lh7a40x_timer_init,
+};