diff options
author | Andrew Bresticker <abrestic@chromium.org> | 2014-09-18 17:47:11 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-11-24 01:44:52 -0500 |
commit | 079a4601768e248ba89dd08d4953e6dae607d7bd (patch) | |
tree | d1e5975f6c556a94f4a40dc14195931b61202659 /arch/mips/kernel/i8259.c | |
parent | f64e55dcbf84f107a68974a0734b3c31db97f169 (diff) |
MIPS: i8259: Use IRQ domains
Create a legacy IRQ domain for the 16 i8259 interrupts.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Qais Yousef <qais.yousef@imgtec.com>
Tested-by: Qais Yousef <qais.yousef@imgtec.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Andrew Bresticker <abrestic@chromium.org>
Cc: Jeffrey Deans <jeffrey.deans@imgtec.com>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: Qais Yousef <qais.yousef@imgtec.com>
Cc: Jonas Gorski <jogo@openwrt.org>
Cc: John Crispin <blogic@openwrt.org>
Cc: David Daney <ddaney.cavm@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/7804/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/i8259.c')
-rw-r--r-- | arch/mips/kernel/i8259.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/arch/mips/kernel/i8259.c b/arch/mips/kernel/i8259.c index 50b364897dda..a74ec3ae557c 100644 --- a/arch/mips/kernel/i8259.c +++ b/arch/mips/kernel/i8259.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/ioport.h> | 13 | #include <linux/ioport.h> |
14 | #include <linux/interrupt.h> | 14 | #include <linux/interrupt.h> |
15 | #include <linux/irqdomain.h> | ||
15 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
16 | #include <linux/spinlock.h> | 17 | #include <linux/spinlock.h> |
17 | #include <linux/syscore_ops.h> | 18 | #include <linux/syscore_ops.h> |
@@ -308,6 +309,19 @@ static struct resource pic2_io_resource = { | |||
308 | .flags = IORESOURCE_BUSY | 309 | .flags = IORESOURCE_BUSY |
309 | }; | 310 | }; |
310 | 311 | ||
312 | static int i8259A_irq_domain_map(struct irq_domain *d, unsigned int virq, | ||
313 | irq_hw_number_t hw) | ||
314 | { | ||
315 | irq_set_chip_and_handler(virq, &i8259A_chip, handle_level_irq); | ||
316 | irq_set_probe(virq); | ||
317 | return 0; | ||
318 | } | ||
319 | |||
320 | static struct irq_domain_ops i8259A_ops = { | ||
321 | .map = i8259A_irq_domain_map, | ||
322 | .xlate = irq_domain_xlate_onecell, | ||
323 | }; | ||
324 | |||
311 | /* | 325 | /* |
312 | * On systems with i8259-style interrupt controllers we assume for | 326 | * On systems with i8259-style interrupt controllers we assume for |
313 | * driver compatibility reasons interrupts 0 - 15 to be the i8259 | 327 | * driver compatibility reasons interrupts 0 - 15 to be the i8259 |
@@ -315,17 +329,17 @@ static struct resource pic2_io_resource = { | |||
315 | */ | 329 | */ |
316 | void __init init_i8259_irqs(void) | 330 | void __init init_i8259_irqs(void) |
317 | { | 331 | { |
318 | int i; | 332 | struct irq_domain *domain; |
319 | 333 | ||
320 | insert_resource(&ioport_resource, &pic1_io_resource); | 334 | insert_resource(&ioport_resource, &pic1_io_resource); |
321 | insert_resource(&ioport_resource, &pic2_io_resource); | 335 | insert_resource(&ioport_resource, &pic2_io_resource); |
322 | 336 | ||
323 | init_8259A(0); | 337 | init_8259A(0); |
324 | 338 | ||
325 | for (i = I8259A_IRQ_BASE; i < I8259A_IRQ_BASE + 16; i++) { | 339 | domain = irq_domain_add_legacy(NULL, 16, I8259A_IRQ_BASE, 0, |
326 | irq_set_chip_and_handler(i, &i8259A_chip, handle_level_irq); | 340 | &i8259A_ops, NULL); |
327 | irq_set_probe(i); | 341 | if (!domain) |
328 | } | 342 | panic("Failed to add i8259 IRQ domain"); |
329 | 343 | ||
330 | setup_irq(I8259A_IRQ_BASE + PIC_CASCADE_IR, &irq2); | 344 | setup_irq(I8259A_IRQ_BASE + PIC_CASCADE_IR, &irq2); |
331 | } | 345 | } |