]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-ixp2000/core.c
Merge branch 'intelfb-patches' of master.kernel.org:/pub/scm/linux/kernel/git/airlied...
[linux-2.6-omap-h63xx.git] / arch / arm / mach-ixp2000 / core.c
index cfd5bef3190bb7a70514a42d957a5995052897a1..22c98e9dad280aff426b4070a24a0a9ec5971ffd 100644 (file)
  * warranty of any kind, whether express or implied.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
 #include <linux/sched.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/serial.h>
 #include <linux/tty.h>
 #include <linux/bitops.h>
@@ -204,15 +204,16 @@ unsigned long ixp2000_gettimeoffset (void)
        return offset / ticks_per_usec;
 }
 
-static int ixp2000_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static int ixp2000_timer_interrupt(int irq, void *dev_id)
 {
        write_seqlock(&xtime_lock);
 
        /* clear timer 1 */
        ixp2000_reg_wrb(IXP2000_T1_CLR, 1);
 
-       while ((next_jiffy_time - *missing_jiffy_timer_csr) > ticks_per_jiffy) {
-               timer_tick(regs);
+       while ((signed long)(next_jiffy_time - *missing_jiffy_timer_csr)
+                                                       >= ticks_per_jiffy) {
+               timer_tick();
                next_jiffy_time -= ticks_per_jiffy;
        }
 
@@ -223,7 +224,7 @@ static int ixp2000_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction ixp2000_timer_irq = {
        .name           = "IXP2000 Timer Tick",
-       .flags          = SA_INTERRUPT | SA_TIMER,
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
        .handler        = ixp2000_timer_interrupt,
 };
 
@@ -288,8 +289,6 @@ void gpio_line_config(int line, int direction)
 
        local_irq_save(flags);
        if (direction == GPIO_OUT) {
-               irq_desc[line + IRQ_IXP2000_GPIO0].valid = 0;
-
                /* if it's an output, it ain't an interrupt anymore */
                GPIO_IRQ_falling_edge &= ~(1 << line);
                GPIO_IRQ_rising_edge &= ~(1 << line);
@@ -303,12 +302,13 @@ void gpio_line_config(int line, int direction)
        }
        local_irq_restore(flags);
 }
+EXPORT_SYMBOL(gpio_line_config);
 
 
 /*************************************************************************
  * IRQ handling IXP2000
  *************************************************************************/
-static void ixp2000_GPIO_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
+static void ixp2000_GPIO_irq_handler(unsigned int irq, struct irqdesc *desc)
 {                               
        int i;
        unsigned long status = *IXP2000_GPIO_INST;
@@ -316,7 +316,7 @@ static void ixp2000_GPIO_irq_handler(unsigned int irq, struct irqdesc *desc, str
        for (i = 0; i <= 7; i++) {
                if (status & (1<<i)) {
                        desc = irq_desc + i + IRQ_IXP2000_GPIO0;
-                       desc_handle_irq(i + IRQ_IXP2000_GPIO0, desc, regs);
+                       desc_handle_irq(i + IRQ_IXP2000_GPIO0, desc);
                }
        }
 }
@@ -351,11 +351,6 @@ static int ixp2000_GPIO_irq_type(unsigned int irq, unsigned int type)
                GPIO_IRQ_level_high &= ~(1 << line);
        update_gpio_int_csrs();
 
-       /*
-        * Finally, mark the corresponding IRQ as valid.
-        */
-       irq_desc[irq].valid = 1;
-
        return 0;
 }
 
@@ -406,7 +401,7 @@ static void ixp2000_pci_irq_unmask(unsigned int irq)
 /*
  * Error interrupts. These are used extensively by the microengine drivers
  */
-static void ixp2000_err_irq_handler(unsigned int irq, struct irqdesc *desc,  struct pt_regs *regs)
+static void ixp2000_err_irq_handler(unsigned int irq, struct irqdesc *desc)
 {
        int i;
        unsigned long status = *IXP2000_IRQ_ERR_STATUS;
@@ -414,7 +409,7 @@ static void ixp2000_err_irq_handler(unsigned int irq, struct irqdesc *desc,  str
        for(i = 31; i >= 0; i--) {
                if(status & (1 << i)) {
                        desc = irq_desc + IRQ_IXP2000_DRAM0_MIN_ERR + i;
-                       desc->handle(IRQ_IXP2000_DRAM0_MIN_ERR + i, desc, regs);
+                       desc_handle_irq(IRQ_IXP2000_DRAM0_MIN_ERR + i, desc);
                }
        }
 }
@@ -506,14 +501,10 @@ void __init ixp2000_init_irq(void)
        }
        set_irq_chained_handler(IRQ_IXP2000_ERRSUM, ixp2000_err_irq_handler);
 
-       /*
-        * GPIO IRQs are invalid until someone sets the interrupt mode
-        * by calling set_irq_type().
-        */
        for (irq = IRQ_IXP2000_GPIO0; irq <= IRQ_IXP2000_GPIO7; irq++) {
                set_irq_chip(irq, &ixp2000_GPIO_irq_chip);
                set_irq_handler(irq, do_level_IRQ);
-               set_irq_flags(irq, 0);
+               set_irq_flags(irq, IRQF_VALID);
        }
        set_irq_chained_handler(IRQ_IXP2000_GPIO, ixp2000_GPIO_irq_handler);