diff options
author | Paul Mundt <lethal@linux-sh.org> | 2010-02-02 03:48:17 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-02-02 03:48:17 -0500 |
commit | 6eb6f98396f7bd653d8fb15b06364c8c7d70e22c (patch) | |
tree | 51155eac621a7cee65d6b3b17fe78d167d3e3945 /arch/sh | |
parent | c7a967273a539a9a38413753c58125e777e2d30d (diff) |
sh: hd6446x: Convert to sparseirq.
Follows the se7724 change and converts the hd64461 IRQ handling to
sparseirq.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/Kconfig | 2 | ||||
-rw-r--r-- | arch/sh/cchips/hd6446x/hd64461.c | 21 |
2 files changed, 20 insertions, 3 deletions
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 0f023bb62f9..9e565d962dc 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
@@ -731,7 +731,7 @@ config GUSA_RB | |||
731 | config SPARSE_IRQ | 731 | config SPARSE_IRQ |
732 | def_bool y | 732 | def_bool y |
733 | depends on SUPERH32 && !SH_DREAMCAST && !SH_HIGHLANDER && \ | 733 | depends on SUPERH32 && !SH_DREAMCAST && !SH_HIGHLANDER && \ |
734 | !SH_RTS7751R2D && !HD64461 | 734 | !SH_RTS7751R2D |
735 | help | 735 | help |
736 | This enables support for sparse irqs. This is useful in general | 736 | This enables support for sparse irqs. This is useful in general |
737 | as most CPUs have a fairly sparse array of IRQ vectors, which | 737 | as most CPUs have a fairly sparse array of IRQ vectors, which |
diff --git a/arch/sh/cchips/hd6446x/hd64461.c b/arch/sh/cchips/hd6446x/hd64461.c index cbfedfb42e0..b447091fc06 100644 --- a/arch/sh/cchips/hd6446x/hd64461.c +++ b/arch/sh/cchips/hd6446x/hd64461.c | |||
@@ -73,7 +73,7 @@ static void hd64461_irq_demux(unsigned int irq, struct irq_desc *desc) | |||
73 | 73 | ||
74 | int __init setup_hd64461(void) | 74 | int __init setup_hd64461(void) |
75 | { | 75 | { |
76 | int i; | 76 | int i, nid = cpu_to_node(boot_cpu_data); |
77 | 77 | ||
78 | if (!MACH_HD64461) | 78 | if (!MACH_HD64461) |
79 | return 0; | 79 | return 0; |
@@ -90,9 +90,26 @@ int __init setup_hd64461(void) | |||
90 | __raw_writew(0xffff, HD64461_NIMR); | 90 | __raw_writew(0xffff, HD64461_NIMR); |
91 | 91 | ||
92 | /* IRQ 80 -> 95 belongs to HD64461 */ | 92 | /* IRQ 80 -> 95 belongs to HD64461 */ |
93 | for (i = HD64461_IRQBASE; i < HD64461_IRQBASE + 16; i++) | 93 | for (i = HD64461_IRQBASE; i < HD64461_IRQBASE + 16; i++) { |
94 | unsigned int irq; | ||
95 | |||
96 | irq = create_irq_nr(i, nid); | ||
97 | if (unlikely(irq == 0)) { | ||
98 | pr_err("%s: failed hooking irq %d for HD64461\n", | ||
99 | __func__, i); | ||
100 | return -EBUSY; | ||
101 | } | ||
102 | |||
103 | if (unlikely(irq != i)) { | ||
104 | pr_err("%s: got irq %d but wanted %d, bailing.\n", | ||
105 | __func__, irq, i); | ||
106 | destroy_irq(irq); | ||
107 | return -EINVAL; | ||
108 | } | ||
109 | |||
94 | set_irq_chip_and_handler(i, &hd64461_irq_chip, | 110 | set_irq_chip_and_handler(i, &hd64461_irq_chip, |
95 | handle_level_irq); | 111 | handle_level_irq); |
112 | } | ||
96 | 113 | ||
97 | set_irq_chained_handler(CONFIG_HD64461_IRQ, hd64461_irq_demux); | 114 | set_irq_chained_handler(CONFIG_HD64461_IRQ, hd64461_irq_demux); |
98 | set_irq_type(CONFIG_HD64461_IRQ, IRQ_TYPE_LEVEL_LOW); | 115 | set_irq_type(CONFIG_HD64461_IRQ, IRQ_TYPE_LEVEL_LOW); |