Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * arch/m68k/q40/q40ints.c |
| 3 | * |
| 4 | * Copyright (C) 1999,2001 Richard Zidlicky |
| 5 | * |
| 6 | * This file is subject to the terms and conditions of the GNU General Public |
| 7 | * License. See the file COPYING in the main directory of this archive |
| 8 | * for more details. |
| 9 | * |
| 10 | * .. used to be loosely based on bvme6000ints.c |
| 11 | * |
| 12 | */ |
| 13 | |
| 14 | #include <linux/types.h> |
| 15 | #include <linux/kernel.h> |
| 16 | #include <linux/errno.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | #include <linux/interrupt.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | #include <asm/ptrace.h> |
| 20 | #include <asm/system.h> |
| 21 | #include <asm/irq.h> |
| 22 | #include <asm/traps.h> |
| 23 | |
| 24 | #include <asm/q40_master.h> |
| 25 | #include <asm/q40ints.h> |
| 26 | |
| 27 | /* |
| 28 | * Q40 IRQs are defined as follows: |
| 29 | * 3,4,5,6,7,10,11,14,15 : ISA dev IRQs |
| 30 | * 16-31: reserved |
| 31 | * 32 : keyboard int |
| 32 | * 33 : frame int (50/200 Hz periodic timer) |
| 33 | * 34 : sample int (10/20 KHz periodic timer) |
| 34 | * |
| 35 | */ |
| 36 | |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 37 | static void q40_irq_handler(unsigned int, struct pt_regs *fp); |
| 38 | static void q40_enable_irq(unsigned int); |
| 39 | static void q40_disable_irq(unsigned int); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 41 | unsigned short q40_ablecount[35]; |
| 42 | unsigned short q40_state[35]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | |
Geert Uytterhoeven | c288bf2 | 2011-04-13 22:31:28 +0200 | [diff] [blame^] | 44 | static unsigned int q40_irq_startup(unsigned int irq) |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 45 | { |
| 46 | /* test for ISA ints not implemented by HW */ |
| 47 | switch (irq) { |
| 48 | case 1: case 2: case 8: case 9: |
| 49 | case 11: case 12: case 13: |
Harvey Harrison | f85e7cd | 2008-04-28 02:13:49 -0700 | [diff] [blame] | 50 | printk("%s: ISA IRQ %d not implemented by HW\n", __func__, irq); |
Geert Uytterhoeven | c288bf2 | 2011-04-13 22:31:28 +0200 | [diff] [blame^] | 51 | /* FIXME return -ENXIO; */ |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 52 | } |
| 53 | return 0; |
| 54 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 55 | |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 56 | static void q40_irq_shutdown(unsigned int irq) |
| 57 | { |
| 58 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | |
Geert Uytterhoeven | c288bf2 | 2011-04-13 22:31:28 +0200 | [diff] [blame^] | 60 | static struct irq_chip q40_irq_chip = { |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 61 | .name = "q40", |
Geert Uytterhoeven | c288bf2 | 2011-04-13 22:31:28 +0200 | [diff] [blame^] | 62 | .irq_startup = q40_irq_startup, |
| 63 | .irq_shutdown = q40_irq_shutdown, |
| 64 | .irq_enable = q40_enable_irq, |
| 65 | .irq_disable = q40_disable_irq, |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 66 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | |
| 68 | /* |
| 69 | * void q40_init_IRQ (void) |
| 70 | * |
| 71 | * Parameters: None |
| 72 | * |
| 73 | * Returns: Nothing |
| 74 | * |
| 75 | * This function is called during kernel startup to initialize |
| 76 | * the q40 IRQ handling routines. |
| 77 | */ |
| 78 | |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 79 | static int disabled; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 80 | |
Al Viro | 66a3f82 | 2007-07-20 04:33:28 +0100 | [diff] [blame] | 81 | void __init q40_init_IRQ(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 82 | { |
Geert Uytterhoeven | c288bf2 | 2011-04-13 22:31:28 +0200 | [diff] [blame^] | 83 | m68k_setup_irq_chip(&q40_irq_chip, 1, Q40_IRQ_MAX); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 84 | |
| 85 | /* setup handler for ISA ints */ |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 86 | m68k_setup_auto_interrupt(q40_irq_handler); |
| 87 | |
| 88 | m68k_irq_startup(IRQ_AUTO_2); |
| 89 | m68k_irq_startup(IRQ_AUTO_4); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 90 | |
| 91 | /* now enable some ints.. */ |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 92 | master_outb(1, EXT_ENABLE_REG); /* ISA IRQ 5-15 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 93 | |
| 94 | /* make sure keyboard IRQ is disabled */ |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 95 | master_outb(0, KEY_IRQ_ENABLE_REG); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 96 | } |
| 97 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 98 | |
| 99 | /* |
| 100 | * this stuff doesn't really belong here.. |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 101 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 102 | |
| 103 | int ql_ticks; /* 200Hz ticks since last jiffie */ |
| 104 | static int sound_ticks; |
| 105 | |
| 106 | #define SVOL 45 |
| 107 | |
| 108 | void q40_mksound(unsigned int hz, unsigned int ticks) |
| 109 | { |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 110 | /* for now ignore hz, except that hz==0 switches off sound */ |
| 111 | /* simply alternate the ampl (128-SVOL)-(128+SVOL)-..-.. at 200Hz */ |
| 112 | if (hz == 0) { |
| 113 | if (sound_ticks) |
| 114 | sound_ticks = 1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 115 | |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 116 | *DAC_LEFT = 128; |
| 117 | *DAC_RIGHT = 128; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 118 | |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 119 | return; |
| 120 | } |
| 121 | /* sound itself is done in q40_timer_int */ |
| 122 | if (sound_ticks == 0) |
| 123 | sound_ticks = 1000; /* pretty long beep */ |
| 124 | sound_ticks = ticks << 1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 125 | } |
| 126 | |
David Howells | 40220c1 | 2006-10-09 12:19:47 +0100 | [diff] [blame] | 127 | static irq_handler_t q40_timer_routine; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 128 | |
Al Viro | 2850bc2 | 2006-10-07 14:16:45 +0100 | [diff] [blame] | 129 | static irqreturn_t q40_timer_int (int irq, void * dev) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 130 | { |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 131 | ql_ticks = ql_ticks ? 0 : 1; |
| 132 | if (sound_ticks) { |
| 133 | unsigned char sval=(sound_ticks & 1) ? 128-SVOL : 128+SVOL; |
| 134 | sound_ticks--; |
| 135 | *DAC_LEFT=sval; |
| 136 | *DAC_RIGHT=sval; |
| 137 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 138 | |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 139 | if (!ql_ticks) |
Al Viro | 2850bc2 | 2006-10-07 14:16:45 +0100 | [diff] [blame] | 140 | q40_timer_routine(irq, dev); |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 141 | return IRQ_HANDLED; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 142 | } |
| 143 | |
David Howells | 40220c1 | 2006-10-09 12:19:47 +0100 | [diff] [blame] | 144 | void q40_sched_init (irq_handler_t timer_routine) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 145 | { |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 146 | int timer_irq; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 147 | |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 148 | q40_timer_routine = timer_routine; |
| 149 | timer_irq = Q40_IRQ_FRAME; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 150 | |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 151 | if (request_irq(timer_irq, q40_timer_int, 0, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 152 | "timer", q40_timer_int)) |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 153 | panic("Couldn't register timer int"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 154 | |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 155 | master_outb(-1, FRAME_CLEAR_REG); |
| 156 | master_outb( 1, FRAME_RATE_REG); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 157 | } |
| 158 | |
| 159 | |
| 160 | /* |
| 161 | * tables to translate bits into IRQ numbers |
| 162 | * it is a good idea to order the entries by priority |
| 163 | * |
| 164 | */ |
| 165 | |
| 166 | struct IRQ_TABLE{ unsigned mask; int irq ;}; |
| 167 | #if 0 |
| 168 | static struct IRQ_TABLE iirqs[]={ |
| 169 | {Q40_IRQ_FRAME_MASK,Q40_IRQ_FRAME}, |
| 170 | {Q40_IRQ_KEYB_MASK,Q40_IRQ_KEYBOARD}, |
| 171 | {0,0}}; |
| 172 | #endif |
| 173 | static struct IRQ_TABLE eirqs[] = { |
| 174 | { .mask = Q40_IRQ3_MASK, .irq = 3 }, /* ser 1 */ |
| 175 | { .mask = Q40_IRQ4_MASK, .irq = 4 }, /* ser 2 */ |
| 176 | { .mask = Q40_IRQ14_MASK, .irq = 14 }, /* IDE 1 */ |
| 177 | { .mask = Q40_IRQ15_MASK, .irq = 15 }, /* IDE 2 */ |
| 178 | { .mask = Q40_IRQ6_MASK, .irq = 6 }, /* floppy, handled elsewhere */ |
| 179 | { .mask = Q40_IRQ7_MASK, .irq = 7 }, /* par */ |
| 180 | { .mask = Q40_IRQ5_MASK, .irq = 5 }, |
| 181 | { .mask = Q40_IRQ10_MASK, .irq = 10 }, |
| 182 | {0,0} |
| 183 | }; |
| 184 | |
| 185 | /* complain only this many times about spurious ints : */ |
Simon Arlott | 0c79cf6 | 2007-10-20 01:20:32 +0200 | [diff] [blame] | 186 | static int ccleirq=60; /* ISA dev IRQs*/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 187 | /*static int cclirq=60;*/ /* internal */ |
| 188 | |
| 189 | /* FIXME: add shared ints,mask,unmask,probing.... */ |
| 190 | |
| 191 | #define IRQ_INPROGRESS 1 |
| 192 | /*static unsigned short saved_mask;*/ |
| 193 | //static int do_tint=0; |
| 194 | |
| 195 | #define DEBUG_Q40INT |
| 196 | /*#define IP_USE_DISABLE *//* would be nice, but crashes ???? */ |
| 197 | |
| 198 | static int mext_disabled=0; /* ext irq disabled by master chip? */ |
| 199 | static int aliased_irq=0; /* how many times inside handler ?*/ |
| 200 | |
| 201 | |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 202 | /* got interrupt, dispatch to ISA or keyboard/timer IRQs */ |
| 203 | static void q40_irq_handler(unsigned int irq, struct pt_regs *fp) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 204 | { |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 205 | unsigned mir, mer; |
| 206 | int i; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 207 | |
| 208 | //repeat: |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 209 | mir = master_inb(IIRQ_REG); |
| 210 | #ifdef CONFIG_BLK_DEV_FD |
| 211 | if ((mir & Q40_IRQ_EXT_MASK) && |
| 212 | (master_inb(EIRQ_REG) & Q40_IRQ6_MASK)) { |
| 213 | floppy_hardint(); |
| 214 | return; |
| 215 | } |
| 216 | #endif |
| 217 | switch (irq) { |
| 218 | case 4: |
| 219 | case 6: |
Al Viro | 2850bc2 | 2006-10-07 14:16:45 +0100 | [diff] [blame] | 220 | __m68k_handle_int(Q40_IRQ_SAMPLE, fp); |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 221 | return; |
| 222 | } |
| 223 | if (mir & Q40_IRQ_FRAME_MASK) { |
Al Viro | 2850bc2 | 2006-10-07 14:16:45 +0100 | [diff] [blame] | 224 | __m68k_handle_int(Q40_IRQ_FRAME, fp); |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 225 | master_outb(-1, FRAME_CLEAR_REG); |
| 226 | } |
| 227 | if ((mir & Q40_IRQ_SER_MASK) || (mir & Q40_IRQ_EXT_MASK)) { |
| 228 | mer = master_inb(EIRQ_REG); |
| 229 | for (i = 0; eirqs[i].mask; i++) { |
| 230 | if (mer & eirqs[i].mask) { |
| 231 | irq = eirqs[i].irq; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 232 | /* |
| 233 | * There is a little mess wrt which IRQ really caused this irq request. The |
| 234 | * main problem is that IIRQ_REG and EIRQ_REG reflect the state when they |
| 235 | * are read - which is long after the request came in. In theory IRQs should |
Simon Arlott | 0c79cf6 | 2007-10-20 01:20:32 +0200 | [diff] [blame] | 236 | * not just go away but they occasionally do |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 237 | */ |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 238 | if (irq > 4 && irq <= 15 && mext_disabled) { |
| 239 | /*aliased_irq++;*/ |
| 240 | goto iirq; |
| 241 | } |
| 242 | if (q40_state[irq] & IRQ_INPROGRESS) { |
| 243 | /* some handlers do local_irq_enable() for irq latency reasons, */ |
| 244 | /* however reentering an active irq handler is not permitted */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 245 | #ifdef IP_USE_DISABLE |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 246 | /* in theory this is the better way to do it because it still */ |
| 247 | /* lets through eg the serial irqs, unfortunately it crashes */ |
| 248 | disable_irq(irq); |
| 249 | disabled = 1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 250 | #else |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 251 | /*printk("IRQ_INPROGRESS detected for irq %d, disabling - %s disabled\n", |
| 252 | irq, disabled ? "already" : "not yet"); */ |
| 253 | fp->sr = (((fp->sr) & (~0x700))+0x200); |
| 254 | disabled = 1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 255 | #endif |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 256 | goto iirq; |
| 257 | } |
| 258 | q40_state[irq] |= IRQ_INPROGRESS; |
Al Viro | 2850bc2 | 2006-10-07 14:16:45 +0100 | [diff] [blame] | 259 | __m68k_handle_int(irq, fp); |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 260 | q40_state[irq] &= ~IRQ_INPROGRESS; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 261 | |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 262 | /* naively enable everything, if that fails than */ |
| 263 | /* this function will be reentered immediately thus */ |
| 264 | /* getting another chance to disable the IRQ */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 265 | |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 266 | if (disabled) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 267 | #ifdef IP_USE_DISABLE |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 268 | if (irq > 4) { |
| 269 | disabled = 0; |
| 270 | enable_irq(irq); |
| 271 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 272 | #else |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 273 | disabled = 0; |
| 274 | /*printk("reenabling irq %d\n", irq); */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 275 | #endif |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 276 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 277 | // used to do 'goto repeat;' here, this delayed bh processing too long |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 278 | return; |
| 279 | } |
| 280 | } |
| 281 | if (mer && ccleirq > 0 && !aliased_irq) { |
| 282 | printk("ISA interrupt from unknown source? EIRQ_REG = %x\n",mer); |
| 283 | ccleirq--; |
| 284 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 285 | } |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 286 | iirq: |
| 287 | mir = master_inb(IIRQ_REG); |
| 288 | /* should test whether keyboard irq is really enabled, doing it in defhand */ |
| 289 | if (mir & Q40_IRQ_KEYB_MASK) |
Al Viro | 2850bc2 | 2006-10-07 14:16:45 +0100 | [diff] [blame] | 290 | __m68k_handle_int(Q40_IRQ_KEYBOARD, fp); |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 291 | |
| 292 | return; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 293 | } |
| 294 | |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 295 | void q40_enable_irq(unsigned int irq) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 296 | { |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 297 | if (irq >= 5 && irq <= 15) { |
| 298 | mext_disabled--; |
| 299 | if (mext_disabled > 0) |
| 300 | printk("q40_enable_irq : nested disable/enable\n"); |
| 301 | if (mext_disabled == 0) |
| 302 | master_outb(1, EXT_ENABLE_REG); |
| 303 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 304 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 305 | |
| 306 | |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 307 | void q40_disable_irq(unsigned int irq) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 308 | { |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 309 | /* disable ISA iqs : only do something if the driver has been |
| 310 | * verified to be Q40 "compatible" - right now IDE, NE2K |
| 311 | * Any driver should not attempt to sleep across disable_irq !! |
| 312 | */ |
| 313 | |
| 314 | if (irq >= 5 && irq <= 15) { |
| 315 | master_outb(0, EXT_ENABLE_REG); |
| 316 | mext_disabled++; |
| 317 | if (mext_disabled > 1) |
| 318 | printk("disable_irq nesting count %d\n",mext_disabled); |
| 319 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 320 | } |
| 321 | |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 322 | unsigned long q40_probe_irq_on(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 323 | { |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 324 | printk("irq probing not working - reconfigure the driver to avoid this\n"); |
| 325 | return -1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 326 | } |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 327 | int q40_probe_irq_off(unsigned long irqs) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 328 | { |
Roman Zippel | 77dda33 | 2006-06-25 05:47:05 -0700 | [diff] [blame] | 329 | return -1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 330 | } |