diff options
Diffstat (limited to 'arch/sh/boards/mach-se/7724/irq.c')
| -rw-r--r-- | arch/sh/boards/mach-se/7724/irq.c | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/arch/sh/boards/mach-se/7724/irq.c b/arch/sh/boards/mach-se/7724/irq.c index c6342ce7768d..5d1d3ec9a6cd 100644 --- a/arch/sh/boards/mach-se/7724/irq.c +++ b/arch/sh/boards/mach-se/7724/irq.c | |||
| @@ -17,8 +17,10 @@ | |||
| 17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
| 18 | #include <linux/irq.h> | 18 | #include <linux/irq.h> |
| 19 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
| 20 | #include <asm/irq.h> | 20 | #include <linux/export.h> |
| 21 | #include <asm/io.h> | 21 | #include <linux/topology.h> |
| 22 | #include <linux/io.h> | ||
| 23 | #include <linux/err.h> | ||
| 22 | #include <mach-se/mach/se7724.h> | 24 | #include <mach-se/mach/se7724.h> |
| 23 | 25 | ||
| 24 | struct fpga_irq { | 26 | struct fpga_irq { |
| @@ -111,7 +113,7 @@ static void se7724_irq_demux(unsigned int irq, struct irq_desc *desc) | |||
| 111 | */ | 113 | */ |
| 112 | void __init init_se7724_IRQ(void) | 114 | void __init init_se7724_IRQ(void) |
| 113 | { | 115 | { |
| 114 | int i, nid = cpu_to_node(boot_cpu_data); | 116 | int irq_base, i; |
| 115 | 117 | ||
| 116 | __raw_writew(0xffff, IRQ0_MR); /* mask all */ | 118 | __raw_writew(0xffff, IRQ0_MR); /* mask all */ |
| 117 | __raw_writew(0xffff, IRQ1_MR); /* mask all */ | 119 | __raw_writew(0xffff, IRQ1_MR); /* mask all */ |
| @@ -121,28 +123,16 @@ void __init init_se7724_IRQ(void) | |||
| 121 | __raw_writew(0x0000, IRQ2_SR); /* clear irq */ | 123 | __raw_writew(0x0000, IRQ2_SR); /* clear irq */ |
| 122 | __raw_writew(0x002a, IRQ_MODE); /* set irq type */ | 124 | __raw_writew(0x002a, IRQ_MODE); /* set irq type */ |
| 123 | 125 | ||
| 124 | for (i = 0; i < SE7724_FPGA_IRQ_NR; i++) { | 126 | irq_base = irq_alloc_descs(SE7724_FPGA_IRQ_BASE, SE7724_FPGA_IRQ_BASE, |
| 125 | int irq, wanted; | 127 | SE7724_FPGA_IRQ_NR, numa_node_id()); |
| 126 | 128 | if (IS_ERR_VALUE(irq_base)) { | |
| 127 | wanted = SE7724_FPGA_IRQ_BASE + i; | 129 | pr_err("%s: failed hooking irqs for FPGA\n", __func__); |
| 128 | 130 | return; | |
| 129 | irq = create_irq_nr(wanted, nid); | 131 | } |
| 130 | if (unlikely(irq == 0)) { | ||
| 131 | pr_err("%s: failed hooking irq %d for FPGA\n", | ||
| 132 | __func__, wanted); | ||
| 133 | return; | ||
| 134 | } | ||
| 135 | |||
| 136 | if (unlikely(irq != wanted)) { | ||
| 137 | pr_err("%s: got irq %d but wanted %d, bailing.\n", | ||
| 138 | __func__, irq, wanted); | ||
| 139 | destroy_irq(irq); | ||
| 140 | return; | ||
| 141 | } | ||
| 142 | 132 | ||
| 143 | irq_set_chip_and_handler_name(irq, &se7724_irq_chip, | 133 | for (i = 0; i < SE7724_FPGA_IRQ_NR; i++) |
| 134 | irq_set_chip_and_handler_name(irq_base + i, &se7724_irq_chip, | ||
| 144 | handle_level_irq, "level"); | 135 | handle_level_irq, "level"); |
| 145 | } | ||
| 146 | 136 | ||
| 147 | irq_set_chained_handler(IRQ0_IRQ, se7724_irq_demux); | 137 | irq_set_chained_handler(IRQ0_IRQ, se7724_irq_demux); |
| 148 | irq_set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW); | 138 | irq_set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW); |
