Skip to contentSkip to conversation

sparc32: introduce build_device_irq

PATCH In review Sam Ravnborg 1 participant 2 messages Feb 13, 2011 – Feb 19, 2011 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 sparc32: introduce build_device_irq

From d28c1be53f7170f578318da0754ccb3ae8771daf Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <[email protected]>
Date: Fri, 11 Feb 2011 20:59:18 +0100
Subject: [PATCH 2/4] sparc32: introduce build_device_irq

build_device_irq() is used to encapsulate the plaform specific details we we build an irq.
For now the default is a simple 1:1 but sun4d differs.

---
 arch/sparc/kernel/irq.h          |    3 ++
 arch/sparc/kernel/irq_32.c       |    6 ++++
 arch/sparc/kernel/of_device_32.c |   59 +++----------------------------------
 arch/sparc/kernel/sun4d_irq.c    |   52 +++++++++++++++++++++++++++++++++
 4 files changed, 66 insertions(+), 54 deletions(-)
arch/sparc/kernel/irq.h +3 -0
index 4b4e54f..d8d2daa 100644
@@ -1,3 +1,5 @@
+#include <linux/platform_device.h>
+
 #include <asm/btfixup.h>
 
 /*
@@ -7,6 +9,7 @@
  */
 struct sparc_irq_config {
 	void (*init_timers)(irq_handler_t);
+	int (*build_device_irq)(struct platform_device *op, int interrupt);
 };
 extern struct sparc_irq_config sparc_irq_config;
 
arch/sparc/kernel/irq_32.c +6 -0
index 7297b8a..8f31959 100644
@@ -587,6 +587,11 @@ int probe_irq_off(unsigned long mask)
 }
 EXPORT_SYMBOL(probe_irq_off);
 
+static int build_device_irq(struct platform_device *op, int interrupt)
+{
+	return interrupt;
+}
+
 /* djhr
  * This could probably be made indirect too and assigned in the CPU
  * bits of the code. That would be much nicer I think and would also
@@ -598,6 +603,7 @@ EXPORT_SYMBOL(probe_irq_off);
 void __init init_IRQ(void)
 {
 	sparc_irq_config.init_timers = irq_panic;
+	sparc_irq_config.build_device_irq = build_device_irq;
 
 	switch (sparc_cpu_model) {
 	case sun4c:
arch/sparc/kernel/of_device_32.c +3 -54

79 lines not on this page · raw message

arch/sparc/kernel/sun4d_irq.c +52 -0

65 lines not on this page · raw message

Signature · 1 line
1.6.0.6
#1 lore raw

PATCH 2/4 sparc32: introduce build_device_irq

build_device_irq() is used to encapsulate the plaform specific details when we build an irq.
For now the default is a simple 1:1 but sun4d differs. This patch refactors functionality - but does not change the existing functionality.

---
 arch/sparc/kernel/irq.h          |    3 ++
 arch/sparc/kernel/irq_32.c       |    7 ++++
 arch/sparc/kernel/of_device_32.c |   59 +++----------------------------------
 arch/sparc/kernel/sun4d_irq.c    |   50 ++++++++++++++++++++++++++++++++
 4 files changed, 65 insertions(+), 54 deletions(-)
arch/sparc/kernel/irq.h +3 -0
index 4b4e54f..d8d2daa 100644
@@ -1,3 +1,5 @@
+#include <linux/platform_device.h>
+
 #include <asm/btfixup.h>
 
 /*
@@ -7,6 +9,7 @@
  */
 struct sparc_irq_config {
 	void (*init_timers)(irq_handler_t);
+	int (*build_device_irq)(struct platform_device *op, int interrupt);
 };
 extern struct sparc_irq_config sparc_irq_config;
 
arch/sparc/kernel/irq_32.c +7 -0
index 0ad3e5a..46453a7 100644
@@ -581,6 +581,11 @@ int probe_irq_off(unsigned long mask)
 }
 EXPORT_SYMBOL(probe_irq_off);
 
+static int build_device_irq(struct platform_device *op, int interrupt)
+{
+	return interrupt;
+}
+
 /* djhr
  * This could probably be made indirect too and assigned in the CPU
  * bits of the code. That would be much nicer I think and would also
@@ -591,6 +596,8 @@ EXPORT_SYMBOL(probe_irq_off);
 
 void __init init_IRQ(void)
 {
+	sparc_irq_config.build_device_irq = build_device_irq;
+
 	switch (sparc_cpu_model) {
 	case sun4c:
 	case sun4:
arch/sparc/kernel/of_device_32.c +3 -54

79 lines not on this page · raw message

arch/sparc/kernel/sun4d_irq.c +50 -0

62 lines not on this page · raw message

Signature · 1 line
1.6.0.6