diff options
Diffstat (limited to 'arch/m68k/q40/q40ints.c')
-rw-r--r-- | arch/m68k/q40/q40ints.c | 60 |
1 files changed, 28 insertions, 32 deletions
diff --git a/arch/m68k/q40/q40ints.c b/arch/m68k/q40/q40ints.c index 9f0e3d59bf92..2b888491f29a 100644 --- a/arch/m68k/q40/q40ints.c +++ b/arch/m68k/q40/q40ints.c | |||
@@ -15,10 +15,10 @@ | |||
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <linux/errno.h> | 16 | #include <linux/errno.h> |
17 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
18 | #include <linux/irq.h> | ||
18 | 19 | ||
19 | #include <asm/ptrace.h> | 20 | #include <asm/ptrace.h> |
20 | #include <asm/system.h> | 21 | #include <asm/system.h> |
21 | #include <asm/irq.h> | ||
22 | #include <asm/traps.h> | 22 | #include <asm/traps.h> |
23 | 23 | ||
24 | #include <asm/q40_master.h> | 24 | #include <asm/q40_master.h> |
@@ -35,35 +35,36 @@ | |||
35 | */ | 35 | */ |
36 | 36 | ||
37 | static void q40_irq_handler(unsigned int, struct pt_regs *fp); | 37 | static void q40_irq_handler(unsigned int, struct pt_regs *fp); |
38 | static void q40_enable_irq(unsigned int); | 38 | static void q40_irq_enable(struct irq_data *data); |
39 | static void q40_disable_irq(unsigned int); | 39 | static void q40_irq_disable(struct irq_data *data); |
40 | 40 | ||
41 | unsigned short q40_ablecount[35]; | 41 | unsigned short q40_ablecount[35]; |
42 | unsigned short q40_state[35]; | 42 | unsigned short q40_state[35]; |
43 | 43 | ||
44 | static int q40_irq_startup(unsigned int irq) | 44 | static unsigned int q40_irq_startup(struct irq_data *data) |
45 | { | 45 | { |
46 | unsigned int irq = data->irq; | ||
47 | |||
46 | /* test for ISA ints not implemented by HW */ | 48 | /* test for ISA ints not implemented by HW */ |
47 | switch (irq) { | 49 | switch (irq) { |
48 | case 1: case 2: case 8: case 9: | 50 | case 1: case 2: case 8: case 9: |
49 | case 11: case 12: case 13: | 51 | case 11: case 12: case 13: |
50 | printk("%s: ISA IRQ %d not implemented by HW\n", __func__, irq); | 52 | printk("%s: ISA IRQ %d not implemented by HW\n", __func__, irq); |
51 | return -ENXIO; | 53 | /* FIXME return -ENXIO; */ |
52 | } | 54 | } |
53 | return 0; | 55 | return 0; |
54 | } | 56 | } |
55 | 57 | ||
56 | static void q40_irq_shutdown(unsigned int irq) | 58 | static void q40_irq_shutdown(struct irq_data *data) |
57 | { | 59 | { |
58 | } | 60 | } |
59 | 61 | ||
60 | static struct irq_controller q40_irq_controller = { | 62 | static struct irq_chip q40_irq_chip = { |
61 | .name = "q40", | 63 | .name = "q40", |
62 | .lock = __SPIN_LOCK_UNLOCKED(q40_irq_controller.lock), | 64 | .irq_startup = q40_irq_startup, |
63 | .startup = q40_irq_startup, | 65 | .irq_shutdown = q40_irq_shutdown, |
64 | .shutdown = q40_irq_shutdown, | 66 | .irq_enable = q40_irq_enable, |
65 | .enable = q40_enable_irq, | 67 | .irq_disable = q40_irq_disable, |
66 | .disable = q40_disable_irq, | ||
67 | }; | 68 | }; |
68 | 69 | ||
69 | /* | 70 | /* |
@@ -81,13 +82,14 @@ static int disabled; | |||
81 | 82 | ||
82 | void __init q40_init_IRQ(void) | 83 | void __init q40_init_IRQ(void) |
83 | { | 84 | { |
84 | m68k_setup_irq_controller(&q40_irq_controller, 1, Q40_IRQ_MAX); | 85 | m68k_setup_irq_controller(&q40_irq_chip, handle_simple_irq, 1, |
86 | Q40_IRQ_MAX); | ||
85 | 87 | ||
86 | /* setup handler for ISA ints */ | 88 | /* setup handler for ISA ints */ |
87 | m68k_setup_auto_interrupt(q40_irq_handler); | 89 | m68k_setup_auto_interrupt(q40_irq_handler); |
88 | 90 | ||
89 | m68k_irq_startup(IRQ_AUTO_2); | 91 | m68k_irq_startup_irq(IRQ_AUTO_2); |
90 | m68k_irq_startup(IRQ_AUTO_4); | 92 | m68k_irq_startup_irq(IRQ_AUTO_4); |
91 | 93 | ||
92 | /* now enable some ints.. */ | 94 | /* now enable some ints.. */ |
93 | master_outb(1, EXT_ENABLE_REG); /* ISA IRQ 5-15 */ | 95 | master_outb(1, EXT_ENABLE_REG); /* ISA IRQ 5-15 */ |
@@ -218,11 +220,11 @@ static void q40_irq_handler(unsigned int irq, struct pt_regs *fp) | |||
218 | switch (irq) { | 220 | switch (irq) { |
219 | case 4: | 221 | case 4: |
220 | case 6: | 222 | case 6: |
221 | __m68k_handle_int(Q40_IRQ_SAMPLE, fp); | 223 | do_IRQ(Q40_IRQ_SAMPLE, fp); |
222 | return; | 224 | return; |
223 | } | 225 | } |
224 | if (mir & Q40_IRQ_FRAME_MASK) { | 226 | if (mir & Q40_IRQ_FRAME_MASK) { |
225 | __m68k_handle_int(Q40_IRQ_FRAME, fp); | 227 | do_IRQ(Q40_IRQ_FRAME, fp); |
226 | master_outb(-1, FRAME_CLEAR_REG); | 228 | master_outb(-1, FRAME_CLEAR_REG); |
227 | } | 229 | } |
228 | if ((mir & Q40_IRQ_SER_MASK) || (mir & Q40_IRQ_EXT_MASK)) { | 230 | if ((mir & Q40_IRQ_SER_MASK) || (mir & Q40_IRQ_EXT_MASK)) { |
@@ -257,7 +259,7 @@ static void q40_irq_handler(unsigned int irq, struct pt_regs *fp) | |||
257 | goto iirq; | 259 | goto iirq; |
258 | } | 260 | } |
259 | q40_state[irq] |= IRQ_INPROGRESS; | 261 | q40_state[irq] |= IRQ_INPROGRESS; |
260 | __m68k_handle_int(irq, fp); | 262 | do_IRQ(irq, fp); |
261 | q40_state[irq] &= ~IRQ_INPROGRESS; | 263 | q40_state[irq] &= ~IRQ_INPROGRESS; |
262 | 264 | ||
263 | /* naively enable everything, if that fails than */ | 265 | /* naively enable everything, if that fails than */ |
@@ -288,25 +290,29 @@ static void q40_irq_handler(unsigned int irq, struct pt_regs *fp) | |||
288 | mir = master_inb(IIRQ_REG); | 290 | mir = master_inb(IIRQ_REG); |
289 | /* should test whether keyboard irq is really enabled, doing it in defhand */ | 291 | /* should test whether keyboard irq is really enabled, doing it in defhand */ |
290 | if (mir & Q40_IRQ_KEYB_MASK) | 292 | if (mir & Q40_IRQ_KEYB_MASK) |
291 | __m68k_handle_int(Q40_IRQ_KEYBOARD, fp); | 293 | do_IRQ(Q40_IRQ_KEYBOARD, fp); |
292 | 294 | ||
293 | return; | 295 | return; |
294 | } | 296 | } |
295 | 297 | ||
296 | void q40_enable_irq(unsigned int irq) | 298 | void q40_irq_enable(struct irq_data *data) |
297 | { | 299 | { |
300 | unsigned int irq = data->irq; | ||
301 | |||
298 | if (irq >= 5 && irq <= 15) { | 302 | if (irq >= 5 && irq <= 15) { |
299 | mext_disabled--; | 303 | mext_disabled--; |
300 | if (mext_disabled > 0) | 304 | if (mext_disabled > 0) |
301 | printk("q40_enable_irq : nested disable/enable\n"); | 305 | printk("q40_irq_enable : nested disable/enable\n"); |
302 | if (mext_disabled == 0) | 306 | if (mext_disabled == 0) |
303 | master_outb(1, EXT_ENABLE_REG); | 307 | master_outb(1, EXT_ENABLE_REG); |
304 | } | 308 | } |
305 | } | 309 | } |
306 | 310 | ||
307 | 311 | ||
308 | void q40_disable_irq(unsigned int irq) | 312 | void q40_irq_disable(struct irq_data *data) |
309 | { | 313 | { |
314 | unsigned int irq = data->irq; | ||
315 | |||
310 | /* disable ISA iqs : only do something if the driver has been | 316 | /* disable ISA iqs : only do something if the driver has been |
311 | * verified to be Q40 "compatible" - right now IDE, NE2K | 317 | * verified to be Q40 "compatible" - right now IDE, NE2K |
312 | * Any driver should not attempt to sleep across disable_irq !! | 318 | * Any driver should not attempt to sleep across disable_irq !! |
@@ -319,13 +325,3 @@ void q40_disable_irq(unsigned int irq) | |||
319 | printk("disable_irq nesting count %d\n",mext_disabled); | 325 | printk("disable_irq nesting count %d\n",mext_disabled); |
320 | } | 326 | } |
321 | } | 327 | } |
322 | |||
323 | unsigned long q40_probe_irq_on(void) | ||
324 | { | ||
325 | printk("irq probing not working - reconfigure the driver to avoid this\n"); | ||
326 | return -1; | ||
327 | } | ||
328 | int q40_probe_irq_off(unsigned long irqs) | ||
329 | { | ||
330 | return -1; | ||
331 | } | ||