diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2008-03-27 14:51:40 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@marvell.com> | 2008-03-27 14:51:40 -0400 |
commit | 01eb569823792ab83b2810fcb31fa38560b08951 (patch) | |
tree | 8387d18b01b87d3d533b7f3f068c0c470af5fbd4 /arch/arm/mach-orion | |
parent | 69b02f6a9639af89c099d06d5f2c4c66a1b03ebf (diff) |
plat-orion: share IRQ handling code
Split off Orion IRQ handling code into plat-orion/, and add
support for multiple sets of (32) interrupts.
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Reviewed-by: Tzachi Perelstein <tzachi@marvell.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Nicolas Pitre <nico@marvell.com>
Diffstat (limited to 'arch/arm/mach-orion')
-rw-r--r-- | arch/arm/mach-orion/irq.c | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/arch/arm/mach-orion/irq.c b/arch/arm/mach-orion/irq.c index df7e12ad378b..855793afcca8 100644 --- a/arch/arm/mach-orion/irq.c +++ b/arch/arm/mach-orion/irq.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/irq.h> | 15 | #include <linux/irq.h> |
16 | #include <asm/gpio.h> | 16 | #include <asm/gpio.h> |
17 | #include <asm/arch/orion.h> | 17 | #include <asm/arch/orion.h> |
18 | #include <asm/plat-orion/irq.h> | ||
18 | #include "common.h" | 19 | #include "common.h" |
19 | 20 | ||
20 | /***************************************************************************** | 21 | /***************************************************************************** |
@@ -197,41 +198,9 @@ static void __init orion_init_gpio_irq(void) | |||
197 | /***************************************************************************** | 198 | /***************************************************************************** |
198 | * Orion Main IRQ | 199 | * Orion Main IRQ |
199 | ****************************************************************************/ | 200 | ****************************************************************************/ |
200 | static void orion_main_irq_mask(u32 irq) | ||
201 | { | ||
202 | orion_clrbits(MAIN_IRQ_MASK, 1 << irq); | ||
203 | } | ||
204 | |||
205 | static void orion_main_irq_unmask(u32 irq) | ||
206 | { | ||
207 | orion_setbits(MAIN_IRQ_MASK, 1 << irq); | ||
208 | } | ||
209 | |||
210 | static struct irq_chip orion_main_irq_chip = { | ||
211 | .name = "Orion-IRQ-Main", | ||
212 | .ack = orion_main_irq_mask, | ||
213 | .mask = orion_main_irq_mask, | ||
214 | .unmask = orion_main_irq_unmask, | ||
215 | }; | ||
216 | |||
217 | static void __init orion_init_main_irq(void) | 201 | static void __init orion_init_main_irq(void) |
218 | { | 202 | { |
219 | int i; | 203 | orion_irq_init(0, (void __iomem *)MAIN_IRQ_MASK); |
220 | |||
221 | /* | ||
222 | * Mask and clear Main IRQ interrupts | ||
223 | */ | ||
224 | orion_write(MAIN_IRQ_MASK, 0x0); | ||
225 | orion_write(MAIN_IRQ_CAUSE, 0x0); | ||
226 | |||
227 | /* | ||
228 | * Register level handler for Main IRQs | ||
229 | */ | ||
230 | for (i = 0; i < IRQ_ORION_GPIO_START; i++) { | ||
231 | set_irq_chip(i, &orion_main_irq_chip); | ||
232 | set_irq_handler(i, handle_level_irq); | ||
233 | set_irq_flags(i, IRQF_VALID); | ||
234 | } | ||
235 | } | 204 | } |
236 | 205 | ||
237 | void __init orion_init_irq(void) | 206 | void __init orion_init_irq(void) |