]> Pileus Git - ~andy/linux/commitdiff
sparc: Implement irq_of_parse_and_map() and irq_dispose_mapping().
authorDavid S. Miller <davem@davemloft.net>
Wed, 20 Aug 2008 23:34:39 +0000 (16:34 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Aug 2008 03:33:55 +0000 (20:33 -0700)
This allows more OF layer code to be shared between powerpc and
sparc.

Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/include/asm/prom.h
arch/sparc/kernel/of_device.c
arch/sparc64/kernel/of_device.c

index b5efc4d85234445b96ac140557d09ebe854d8437..58b85fa56066c5f1cd4aeff7f0a5c67612c175fb 100644 (file)
@@ -96,6 +96,14 @@ static inline void of_node_put(struct device_node *node)
 {
 }
 
+/* These routines are here to provide compatibility with how powerpc
+ * handles IRQ mapping for OF device nodes.  We precompute and permanently
+ * register them in the of_device objects, whereas powerpc computes them
+ * on request.
+ */
+extern int irq_of_parse_and_map(struct device_node *node, int index);
+#define irq_dispose_mapping(irq) do { } while (0)
+
 /*
  * NB:  This is here while we transition from using asm/prom.h
  * to linux/of.h
index cc4c235c4f592e5e193429bfb346656287c8092f..56e9a718ef8f4f56929f820c50e984522a16646b 100644 (file)
@@ -29,6 +29,17 @@ struct of_device *of_find_device_by_node(struct device_node *dp)
 }
 EXPORT_SYMBOL(of_find_device_by_node);
 
+int irq_of_parse_and_map(struct device_node *node, int index)
+{
+       struct of_device *op = of_find_device_by_node(node);
+
+       if (!op || index >= op->num_irqs)
+               return 0xffffffff;
+
+       return op->irqs[index];
+}
+EXPORT_SYMBOL(irq_of_parse_and_map);
+
 #ifdef CONFIG_PCI
 struct bus_type ebus_bus_type;
 EXPORT_SYMBOL(ebus_bus_type);
index f8b50cbf4bf711658ef3ad742270da424cbf4294..8a0d82343a257b6783b6bd718ee745d3d95815cf 100644 (file)
@@ -55,6 +55,17 @@ struct of_device *of_find_device_by_node(struct device_node *dp)
 }
 EXPORT_SYMBOL(of_find_device_by_node);
 
+int irq_of_parse_and_map(struct device_node *node, int index)
+{
+       struct of_device *op = of_find_device_by_node(node);
+
+       if (!op || index >= op->num_irqs)
+               return 0xffffffff;
+
+       return op->irqs[index];
+}
+EXPORT_SYMBOL(irq_of_parse_and_map);
+
 #ifdef CONFIG_PCI
 struct bus_type ebus_bus_type;
 EXPORT_SYMBOL(ebus_bus_type);