diff options
author | Matt Fleming <mjf@gentoo.org> | 2008-12-14 07:02:24 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-12-22 04:44:05 -0500 |
commit | be729fd8900f0026238539de46d867d232d1e913 (patch) | |
tree | ded93267eb157a5539db316412d3dc254294cc6d /arch/sh/boards/mach-microdev | |
parent | 180ae2037f5bc33b0597ddbb76d36b08a74a238a (diff) |
sh: Convert Microdev boards from hw_interrupt_type to irq_chip
This is part of the SH move to irq_chip.
Signed-off-by: Matt Fleming <mjf@gentoo.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards/mach-microdev')
-rw-r--r-- | arch/sh/boards/mach-microdev/irq.c | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/arch/sh/boards/mach-microdev/irq.c b/arch/sh/boards/mach-microdev/irq.c index 702753cbd28f..b551963579c1 100644 --- a/arch/sh/boards/mach-microdev/irq.c +++ b/arch/sh/boards/mach-microdev/irq.c | |||
@@ -67,27 +67,13 @@ static const struct { | |||
67 | 67 | ||
68 | static void enable_microdev_irq(unsigned int irq); | 68 | static void enable_microdev_irq(unsigned int irq); |
69 | static void disable_microdev_irq(unsigned int irq); | 69 | static void disable_microdev_irq(unsigned int irq); |
70 | |||
71 | /* shutdown is same as "disable" */ | ||
72 | #define shutdown_microdev_irq disable_microdev_irq | ||
73 | |||
74 | static void mask_and_ack_microdev(unsigned int); | 70 | static void mask_and_ack_microdev(unsigned int); |
75 | static void end_microdev_irq(unsigned int irq); | ||
76 | |||
77 | static unsigned int startup_microdev_irq(unsigned int irq) | ||
78 | { | ||
79 | enable_microdev_irq(irq); | ||
80 | return 0; /* never anything pending */ | ||
81 | } | ||
82 | 71 | ||
83 | static struct hw_interrupt_type microdev_irq_type = { | 72 | static struct irq_chip microdev_irq_type = { |
84 | .typename = "MicroDev-IRQ", | 73 | .name = "MicroDev-IRQ", |
85 | .startup = startup_microdev_irq, | 74 | .unmask = enable_microdev_irq, |
86 | .shutdown = shutdown_microdev_irq, | 75 | .mask = disable_microdev_irq, |
87 | .enable = enable_microdev_irq, | ||
88 | .disable = disable_microdev_irq, | ||
89 | .ack = mask_and_ack_microdev, | 76 | .ack = mask_and_ack_microdev, |
90 | .end = end_microdev_irq | ||
91 | }; | 77 | }; |
92 | 78 | ||
93 | static void disable_microdev_irq(unsigned int irq) | 79 | static void disable_microdev_irq(unsigned int irq) |
@@ -130,11 +116,11 @@ static void enable_microdev_irq(unsigned int irq) | |||
130 | ctrl_outl(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTENB_REG); | 116 | ctrl_outl(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTENB_REG); |
131 | } | 117 | } |
132 | 118 | ||
133 | /* This functions sets the desired irq handler to be a MicroDev type */ | 119 | /* This function sets the desired irq handler to be a MicroDev type */ |
134 | static void __init make_microdev_irq(unsigned int irq) | 120 | static void __init make_microdev_irq(unsigned int irq) |
135 | { | 121 | { |
136 | disable_irq_nosync(irq); | 122 | disable_irq_nosync(irq); |
137 | irq_desc[irq].chip = µdev_irq_type; | 123 | set_irq_chip_and_handler(irq, µdev_irq_type, handle_level_irq); |
138 | disable_microdev_irq(irq); | 124 | disable_microdev_irq(irq); |
139 | } | 125 | } |
140 | 126 | ||
@@ -143,17 +129,11 @@ static void mask_and_ack_microdev(unsigned int irq) | |||
143 | disable_microdev_irq(irq); | 129 | disable_microdev_irq(irq); |
144 | } | 130 | } |
145 | 131 | ||
146 | static void end_microdev_irq(unsigned int irq) | ||
147 | { | ||
148 | if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) | ||
149 | enable_microdev_irq(irq); | ||
150 | } | ||
151 | |||
152 | extern void __init init_microdev_irq(void) | 132 | extern void __init init_microdev_irq(void) |
153 | { | 133 | { |
154 | int i; | 134 | int i; |
155 | 135 | ||
156 | /* disable interrupts on the FPGA INTC register */ | 136 | /* disable interrupts on the FPGA INTC register */ |
157 | ctrl_outl(~0ul, MICRODEV_FPGA_INTDSB_REG); | 137 | ctrl_outl(~0ul, MICRODEV_FPGA_INTDSB_REG); |
158 | 138 | ||
159 | for (i = 0; i < NUM_EXTERNAL_IRQS; i++) | 139 | for (i = 0; i < NUM_EXTERNAL_IRQS; i++) |
@@ -179,5 +159,3 @@ extern void microdev_print_fpga_intc_status(void) | |||
179 | printk("FPGA_INTPRI[3..0] = %08x:%08x:%08x:%08x\n", *intprid, *intpric, *intprib, *intpria); | 159 | printk("FPGA_INTPRI[3..0] = %08x:%08x:%08x:%08x\n", *intprid, *intpric, *intprib, *intpria); |
180 | printk("-------------------------------------------------------------------------------\n"); | 160 | printk("-------------------------------------------------------------------------------\n"); |
181 | } | 161 | } |
182 | |||
183 | |||