aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/sgi-ip22/ip22-eisa.c
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2006-11-01 12:08:36 -0500
committerRalf Baechle <ralf@linux-mips.org>2006-11-29 20:14:46 -0500
commit1603b5aca4f15b34848fb5594d0c7b6333b99144 (patch)
tree79272aa41d6510b7256df62e287676885c3960cf /arch/mips/sgi-ip22/ip22-eisa.c
parentc87b6ebaea034c0e0ce86127870cf1511a307b64 (diff)
[MIPS] IRQ cleanups
This is a big irq cleanup patch. * Use set_irq_chip() to register irq_chip. * Initialize .mask, .unmask, .mask_ack field. Functions for these method are already exist in most case. * Do not initialize .startup, .shutdown, .enable, .disable fields if default routines provided by irq_chip_set_defaults() were suitable. * Remove redundant irq_desc initializations. * Remove unnecessary local_irq_save/local_irq_restore, spin_lock. With this cleanup, it would be easy to switch to slightly lightwait irq flow handlers (handle_level_irq(), etc.) instead of __do_IRQ(). Though whole this patch is quite large, changes in each irq_chip are not quite simple. Please review and test on your platform. Thanks. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/sgi-ip22/ip22-eisa.c')
-rw-r--r--arch/mips/sgi-ip22/ip22-eisa.c33
1 files changed, 8 insertions, 25 deletions
diff --git a/arch/mips/sgi-ip22/ip22-eisa.c b/arch/mips/sgi-ip22/ip22-eisa.c
index 0d18ed47c47a..a1a9af6da7bf 100644
--- a/arch/mips/sgi-ip22/ip22-eisa.c
+++ b/arch/mips/sgi-ip22/ip22-eisa.c
@@ -95,16 +95,11 @@ static irqreturn_t ip22_eisa_intr(int irq, void *dev_id)
95 95
96static void enable_eisa1_irq(unsigned int irq) 96static void enable_eisa1_irq(unsigned int irq)
97{ 97{
98 unsigned long flags;
99 u8 mask; 98 u8 mask;
100 99
101 local_irq_save(flags);
102
103 mask = inb(EISA_INT1_MASK); 100 mask = inb(EISA_INT1_MASK);
104 mask &= ~((u8) (1 << irq)); 101 mask &= ~((u8) (1 << irq));
105 outb(mask, EISA_INT1_MASK); 102 outb(mask, EISA_INT1_MASK);
106
107 local_irq_restore(flags);
108} 103}
109 104
110static unsigned int startup_eisa1_irq(unsigned int irq) 105static unsigned int startup_eisa1_irq(unsigned int irq)
@@ -130,8 +125,6 @@ static void disable_eisa1_irq(unsigned int irq)
130 outb(mask, EISA_INT1_MASK); 125 outb(mask, EISA_INT1_MASK);
131} 126}
132 127
133#define shutdown_eisa1_irq disable_eisa1_irq
134
135static void mask_and_ack_eisa1_irq(unsigned int irq) 128static void mask_and_ack_eisa1_irq(unsigned int irq)
136{ 129{
137 disable_eisa1_irq(irq); 130 disable_eisa1_irq(irq);
@@ -148,25 +141,20 @@ static void end_eisa1_irq(unsigned int irq)
148static struct irq_chip ip22_eisa1_irq_type = { 141static struct irq_chip ip22_eisa1_irq_type = {
149 .typename = "IP22 EISA", 142 .typename = "IP22 EISA",
150 .startup = startup_eisa1_irq, 143 .startup = startup_eisa1_irq,
151 .shutdown = shutdown_eisa1_irq,
152 .enable = enable_eisa1_irq,
153 .disable = disable_eisa1_irq,
154 .ack = mask_and_ack_eisa1_irq, 144 .ack = mask_and_ack_eisa1_irq,
145 .mask = disable_eisa1_irq,
146 .mask_ack = mask_and_ack_eisa1_irq,
147 .unmask = enable_eisa1_irq,
155 .end = end_eisa1_irq, 148 .end = end_eisa1_irq,
156}; 149};
157 150
158static void enable_eisa2_irq(unsigned int irq) 151static void enable_eisa2_irq(unsigned int irq)
159{ 152{
160 unsigned long flags;
161 u8 mask; 153 u8 mask;
162 154
163 local_irq_save(flags);
164
165 mask = inb(EISA_INT2_MASK); 155 mask = inb(EISA_INT2_MASK);
166 mask &= ~((u8) (1 << (irq - 8))); 156 mask &= ~((u8) (1 << (irq - 8)));
167 outb(mask, EISA_INT2_MASK); 157 outb(mask, EISA_INT2_MASK);
168
169 local_irq_restore(flags);
170} 158}
171 159
172static unsigned int startup_eisa2_irq(unsigned int irq) 160static unsigned int startup_eisa2_irq(unsigned int irq)
@@ -192,8 +180,6 @@ static void disable_eisa2_irq(unsigned int irq)
192 outb(mask, EISA_INT2_MASK); 180 outb(mask, EISA_INT2_MASK);
193} 181}
194 182
195#define shutdown_eisa2_irq disable_eisa2_irq
196
197static void mask_and_ack_eisa2_irq(unsigned int irq) 183static void mask_and_ack_eisa2_irq(unsigned int irq)
198{ 184{
199 disable_eisa2_irq(irq); 185 disable_eisa2_irq(irq);
@@ -210,10 +196,10 @@ static void end_eisa2_irq(unsigned int irq)
210static struct irq_chip ip22_eisa2_irq_type = { 196static struct irq_chip ip22_eisa2_irq_type = {
211 .typename = "IP22 EISA", 197 .typename = "IP22 EISA",
212 .startup = startup_eisa2_irq, 198 .startup = startup_eisa2_irq,
213 .shutdown = shutdown_eisa2_irq,
214 .enable = enable_eisa2_irq,
215 .disable = disable_eisa2_irq,
216 .ack = mask_and_ack_eisa2_irq, 199 .ack = mask_and_ack_eisa2_irq,
200 .mask = disable_eisa2_irq,
201 .mask_ack = mask_and_ack_eisa2_irq,
202 .unmask = enable_eisa2_irq,
217 .end = end_eisa2_irq, 203 .end = end_eisa2_irq,
218}; 204};
219 205
@@ -275,13 +261,10 @@ int __init ip22_eisa_init(void)
275 outb(0, EISA_DMA2_WRITE_SINGLE); 261 outb(0, EISA_DMA2_WRITE_SINGLE);
276 262
277 for (i = SGINT_EISA; i < (SGINT_EISA + EISA_MAX_IRQ); i++) { 263 for (i = SGINT_EISA; i < (SGINT_EISA + EISA_MAX_IRQ); i++) {
278 irq_desc[i].status = IRQ_DISABLED;
279 irq_desc[i].action = 0;
280 irq_desc[i].depth = 1;
281 if (i < (SGINT_EISA + 8)) 264 if (i < (SGINT_EISA + 8))
282 irq_desc[i].chip = &ip22_eisa1_irq_type; 265 set_irq_chip(i, &ip22_eisa1_irq_type);
283 else 266 else
284 irq_desc[i].chip = &ip22_eisa2_irq_type; 267 set_irq_chip(i, &ip22_eisa2_irq_type);
285 } 268 }
286 269
287 /* Cannot use request_irq because of kmalloc not being ready at such 270 /* Cannot use request_irq because of kmalloc not being ready at such