]> Pileus Git - ~andy/linux/blobdiff - arch/arm/mach-omap2/irq.c
Merge branch 'for-upstream' of http://github.com/agraf/linux-2.6 into queue
[~andy/linux] / arch / arm / mach-omap2 / irq.c
index 6038a8c84b743af0ed1f205af643f3a8a0013b63..3926f370448f91825fd07b4cdcaa0af09db74b2b 100644 (file)
@@ -21,9 +21,9 @@
 #include <linux/irqdomain.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
+#include <linux/of_irq.h>
 
-#include <mach/hardware.h>
-
+#include "soc.h"
 #include "iomap.h"
 #include "common.h"
 
@@ -48,6 +48,8 @@
 #define OMAP3_IRQ_BASE         OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)
 #define INTCPS_SIR_IRQ_OFFSET  0x0040  /* omap2/3 active interrupt offset */
 #define ACTIVEIRQ_MASK         0x7f    /* omap2/3 active interrupt bits */
+#define INTCPS_NR_MIR_REGS     3
+#define INTCPS_NR_IRQS         96
 
 /*
  * OMAP2 has a number of different interrupt controllers, each interrupt
@@ -106,9 +108,8 @@ static void __init omap_irq_bank_init_one(struct omap_irq_bank *bank)
        unsigned long tmp;
 
        tmp = intc_bank_read_reg(bank, INTC_REVISION) & 0xff;
-       printk(KERN_INFO "IRQ: Found an INTC at 0x%p "
-                        "(revision %ld.%ld) with %d interrupts\n",
-                        bank->base_reg, tmp >> 4, tmp & 0xf, bank->nr_irqs);
+       pr_info("IRQ: Found an INTC at 0x%p (revision %ld.%ld) with %d interrupts\n",
+               bank->base_reg, tmp >> 4, tmp & 0xf, bank->nr_irqs);
 
        tmp = intc_bank_read_reg(bank, INTC_SYSCONFIG);
        tmp |= 1 << 1;  /* soft reset */
@@ -258,11 +259,11 @@ asmlinkage void __exception_irq_entry omap2_intc_handle_irq(struct pt_regs *regs
        omap_intc_handle_irq(base_addr, regs);
 }
 
-int __init omap_intc_of_init(struct device_node *node,
+int __init intc_of_init(struct device_node *node,
                             struct device_node *parent)
 {
        struct resource res;
-       u32 nr_irqs = 96;
+       u32 nr_irq = 96;
 
        if (WARN_ON(!node))
                return -ENODEV;
@@ -272,15 +273,25 @@ int __init omap_intc_of_init(struct device_node *node,
                return -EINVAL;
        }
 
-       if (of_property_read_u32(node, "ti,intc-size", &nr_irqs))
-               pr_warn("unable to get intc-size, default to %d\n", nr_irqs);
+       if (of_property_read_u32(node, "ti,intc-size", &nr_irq))
+               pr_warn("unable to get intc-size, default to %d\n", nr_irq);
 
-       omap_init_irq(res.start, nr_irqs, of_node_get(node));
+       omap_init_irq(res.start, nr_irq, of_node_get(node));
 
        return 0;
 }
 
-#ifdef CONFIG_ARCH_OMAP3
+static struct of_device_id irq_match[] __initdata = {
+       { .compatible = "ti,omap2-intc", .data = intc_of_init, },
+       { }
+};
+
+void __init omap_intc_of_init(void)
+{
+       of_irq_init(irq_match);
+}
+
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX)
 static struct omap3_intc_regs intc_context[ARRAY_SIZE(irq_banks)];
 
 void omap_intc_save_context(void)