diff options
author | Magnus Damm <damm@igel.co.jp> | 2007-06-15 05:56:19 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2007-06-15 05:56:19 -0400 |
commit | 68abdbbb03476a60d932eeba0035dd5069afec38 (patch) | |
tree | de3854f76d6d9aec121c432a3cd276bb756003c9 /arch/sh/boards/snapgear/setup.c | |
parent | 50f63f2518ee68bc132d357d2b6fdb7f60ef79e0 (diff) |
sh: rework ipr code
This patch reworks the ipr code by grouping the offset array together
with the ipr_data structure in a new data structure called ipr_desc.
This new structure also contains the name of the controller in struct
irq_chip. The idea behind putting struct irq_chip in there is that we
can use offsetof() to locate the base addresses in the irq_chip
callbacks. This strategy has much in common with the recently merged
intc2 code.
One logic change has been made - the original ipr code enabled the
interrupts by default but with this patch they are all disabled by
default.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards/snapgear/setup.c')
-rw-r--r-- | arch/sh/boards/snapgear/setup.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/arch/sh/boards/snapgear/setup.c b/arch/sh/boards/snapgear/setup.c index b40124c092f..84271d85a8d 100644 --- a/arch/sh/boards/snapgear/setup.c +++ b/arch/sh/boards/snapgear/setup.c | |||
@@ -68,11 +68,27 @@ module_init(eraseconfig_init); | |||
68 | * IRL3 = crypto | 68 | * IRL3 = crypto |
69 | */ | 69 | */ |
70 | 70 | ||
71 | static struct ipr_data snapgear_ipr_map[] = { | 71 | static struct ipr_data ipr_irq_table[] = { |
72 | make_ipr_irq(IRL0_IRQ, IRL0_IPR_ADDR, IRL0_IPR_POS, IRL0_PRIORITY); | 72 | { IRL0_IRQ, 0, IRL0_IPR_POS, IRL0_PRIORITY }, |
73 | make_ipr_irq(IRL1_IRQ, IRL1_IPR_ADDR, IRL1_IPR_POS, IRL1_PRIORITY); | 73 | { IRL1_IRQ, 0, IRL1_IPR_POS, IRL1_PRIORITY }, |
74 | make_ipr_irq(IRL2_IRQ, IRL2_IPR_ADDR, IRL2_IPR_POS, IRL2_PRIORITY); | 74 | { IRL2_IRQ, 0, IRL2_IPR_POS, IRL2_PRIORITY }, |
75 | make_ipr_irq(IRL3_IRQ, IRL3_IPR_ADDR, IRL3_IPR_POS, IRL3_PRIORITY); | 75 | { IRL3_IRQ, 0, IRL3_IPR_POS, IRL3_PRIORITY }, |
76 | }; | ||
77 | |||
78 | static unsigned long ipr_offsets[] = { | ||
79 | INTC_IPRD, | ||
80 | }; | ||
81 | |||
82 | static struct ipr_desc ipr_irq_desc = { | ||
83 | .ipr_offsets = ipr_offsets, | ||
84 | .nr_offsets = ARRAY_SIZE(ipr_offsets), | ||
85 | |||
86 | .ipr_data = ipr_irq_table, | ||
87 | .nr_irqs = ARRAY_SIZE(ipr_irq_table), | ||
88 | |||
89 | .chip = { | ||
90 | .name = "IPR-snapgear", | ||
91 | }, | ||
76 | }; | 92 | }; |
77 | 93 | ||
78 | static void __init init_snapgear_IRQ(void) | 94 | static void __init init_snapgear_IRQ(void) |
@@ -82,7 +98,7 @@ static void __init init_snapgear_IRQ(void) | |||
82 | 98 | ||
83 | printk("Setup SnapGear IRQ/IPR ...\n"); | 99 | printk("Setup SnapGear IRQ/IPR ...\n"); |
84 | 100 | ||
85 | make_ipr_irq(snapgear_ipr_map, ARRAY_SIZE(snapgear_ipr_map)); | 101 | register_ipr_controller(&ipr_irq_desc); |
86 | } | 102 | } |
87 | 103 | ||
88 | /* | 104 | /* |