summaryrefslogtreecommitdiff
path: root/arch/sh/boards/mach-dreamcast/irq.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-02-02 12:01:55 +0300
committerPaul Mundt <lethal@linux-sh.org>2010-02-02 12:01:55 +0300
commitdeb9b22b8968fa0166d89c8ad1346e816cf1aec4 (patch)
treea8f2a46d7498182c11bda07916b4b954c8541a8a /arch/sh/boards/mach-dreamcast/irq.c
parent6eb6f98396f7bd653d8fb15b06364c8c7d70e22c (diff)
downloadlinux-deb9b22b8968fa0166d89c8ad1346e816cf1aec4.tar.xz
sh: mach-dreamcast: Convert to sparseirq.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards/mach-dreamcast/irq.c')
-rw-r--r--arch/sh/boards/mach-dreamcast/irq.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/sh/boards/mach-dreamcast/irq.c b/arch/sh/boards/mach-dreamcast/irq.c
index f55fc8e795e9..d932667410ab 100644
--- a/arch/sh/boards/mach-dreamcast/irq.c
+++ b/arch/sh/boards/mach-dreamcast/irq.c
@@ -135,3 +135,30 @@ int systemasic_irq_demux(int irq)
/* Not reached */
return irq;
}
+
+void systemasic_irq_init(void)
+{
+ int i, nid = cpu_to_node(boot_cpu_data);
+
+ /* Assign all virtual IRQs to the System ASIC int. handler */
+ for (i = HW_EVENT_IRQ_BASE; i < HW_EVENT_IRQ_MAX; i++) {
+ unsigned int irq;
+
+ irq = create_irq_nr(i, nid);
+ if (unlikely(irq == 0)) {
+ pr_err("%s: failed hooking irq %d for systemasic\n",
+ __func__, i);
+ return;
+ }
+
+ if (unlikely(irq != i)) {
+ pr_err("%s: got irq %d but wanted %d, bailing.\n",
+ __func__, irq, i);
+ destroy_irq(irq);
+ return;
+ }
+
+ set_irq_chip_and_handler(i, &systemasic_int,
+ handle_level_irq);
+ }
+}