diff options
author | Finn Thain <fthain@telegraphics.com.au> | 2011-10-23 10:11:14 -0400 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2011-12-10 13:52:46 -0500 |
commit | 30c0527d15ce4edcde64581e9d062ba9fb08fe16 (patch) | |
tree | da3e996d43a671d2d66075fdc7676f17c688b415 /arch/m68k | |
parent | 56e63689fd866a865682fe14dc5a7e1ec3b2c3ad (diff) |
m68k/mac: cleanup mac_irq_pending
mac_irq_pending() has only one caller (mac_esp.c). Nothing tests for Baboon, PSC or OSS pending interrupts. Until that need arises, let's keep it simple and remove all the unused abstraction. Replace it with a routine to check for SCSI DRQ.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k')
-rw-r--r-- | arch/m68k/include/asm/mac_via.h | 2 | ||||
-rw-r--r-- | arch/m68k/include/asm/macintosh.h | 2 | ||||
-rw-r--r-- | arch/m68k/mac/baboon.c | 7 | ||||
-rw-r--r-- | arch/m68k/mac/macints.c | 32 | ||||
-rw-r--r-- | arch/m68k/mac/oss.c | 29 | ||||
-rw-r--r-- | arch/m68k/mac/psc.c | 9 | ||||
-rw-r--r-- | arch/m68k/mac/via.c | 28 |
7 files changed, 9 insertions, 100 deletions
diff --git a/arch/m68k/include/asm/mac_via.h b/arch/m68k/include/asm/mac_via.h index a59665e1d41b..3622cf89f831 100644 --- a/arch/m68k/include/asm/mac_via.h +++ b/arch/m68k/include/asm/mac_via.h | |||
@@ -254,6 +254,8 @@ | |||
254 | extern volatile __u8 *via1,*via2; | 254 | extern volatile __u8 *via1,*via2; |
255 | extern int rbv_present,via_alt_mapping; | 255 | extern int rbv_present,via_alt_mapping; |
256 | 256 | ||
257 | extern int via2_scsi_drq_pending(void); | ||
258 | |||
257 | static inline int rbv_set_video_bpp(int bpp) | 259 | static inline int rbv_set_video_bpp(int bpp) |
258 | { | 260 | { |
259 | char val = (bpp==1)?0:(bpp==2)?1:(bpp==4)?2:(bpp==8)?3:-1; | 261 | char val = (bpp==1)?0:(bpp==2)?1:(bpp==4)?2:(bpp==8)?3:-1; |
diff --git a/arch/m68k/include/asm/macintosh.h b/arch/m68k/include/asm/macintosh.h index 12ebe43b008b..e5bf02d3741d 100644 --- a/arch/m68k/include/asm/macintosh.h +++ b/arch/m68k/include/asm/macintosh.h | |||
@@ -11,7 +11,7 @@ | |||
11 | extern void mac_reset(void); | 11 | extern void mac_reset(void); |
12 | extern void mac_poweroff(void); | 12 | extern void mac_poweroff(void); |
13 | extern void mac_init_IRQ(void); | 13 | extern void mac_init_IRQ(void); |
14 | extern int mac_irq_pending(unsigned int); | 14 | |
15 | extern void mac_irq_enable(struct irq_data *data); | 15 | extern void mac_irq_enable(struct irq_data *data); |
16 | extern void mac_irq_disable(struct irq_data *data); | 16 | extern void mac_irq_disable(struct irq_data *data); |
17 | 17 | ||
diff --git a/arch/m68k/mac/baboon.c b/arch/m68k/mac/baboon.c index b51ebaa54141..c97429129be3 100644 --- a/arch/m68k/mac/baboon.c +++ b/arch/m68k/mac/baboon.c | |||
@@ -123,10 +123,3 @@ void baboon_irq_disable(int irq) | |||
123 | if (baboon_disabled) | 123 | if (baboon_disabled) |
124 | mac_irq_disable(irq_get_irq_data(IRQ_NUBUS_C)); | 124 | mac_irq_disable(irq_get_irq_data(IRQ_NUBUS_C)); |
125 | } | 125 | } |
126 | |||
127 | int baboon_irq_pending(int irq) | ||
128 | { | ||
129 | int irq_idx = IRQ_IDX(irq); | ||
130 | |||
131 | return baboon->mb_ifr & (1 << irq_idx); | ||
132 | } | ||
diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c index 8fdd990e04ba..fb6147110b34 100644 --- a/arch/m68k/mac/macints.c +++ b/arch/m68k/mac/macints.c | |||
@@ -142,7 +142,6 @@ extern void via_register_interrupts(void); | |||
142 | extern void via_irq_enable(int); | 142 | extern void via_irq_enable(int); |
143 | extern void via_irq_disable(int); | 143 | extern void via_irq_disable(int); |
144 | extern void via_irq_clear(int); | 144 | extern void via_irq_clear(int); |
145 | extern int via_irq_pending(int); | ||
146 | 145 | ||
147 | /* | 146 | /* |
148 | * OSS hooks | 147 | * OSS hooks |
@@ -152,7 +151,6 @@ extern void oss_register_interrupts(void); | |||
152 | extern void oss_irq_enable(int); | 151 | extern void oss_irq_enable(int); |
153 | extern void oss_irq_disable(int); | 152 | extern void oss_irq_disable(int); |
154 | extern void oss_irq_clear(int); | 153 | extern void oss_irq_clear(int); |
155 | extern int oss_irq_pending(int); | ||
156 | 154 | ||
157 | /* | 155 | /* |
158 | * PSC hooks | 156 | * PSC hooks |
@@ -162,7 +160,6 @@ extern void psc_register_interrupts(void); | |||
162 | extern void psc_irq_enable(int); | 160 | extern void psc_irq_enable(int); |
163 | extern void psc_irq_disable(int); | 161 | extern void psc_irq_disable(int); |
164 | extern void psc_irq_clear(int); | 162 | extern void psc_irq_clear(int); |
165 | extern int psc_irq_pending(int); | ||
166 | 163 | ||
167 | /* | 164 | /* |
168 | * IOP hooks | 165 | * IOP hooks |
@@ -239,7 +236,6 @@ void __init mac_init_IRQ(void) | |||
239 | /* | 236 | /* |
240 | * mac_irq_enable - enable an interrupt source | 237 | * mac_irq_enable - enable an interrupt source |
241 | * mac_irq_disable - disable an interrupt source | 238 | * mac_irq_disable - disable an interrupt source |
242 | * mac_irq_pending - returns the pending status of an IRQ (nonzero = pending) | ||
243 | * | 239 | * |
244 | * These routines are just dispatchers to the VIA/OSS/PSC routines. | 240 | * These routines are just dispatchers to the VIA/OSS/PSC routines. |
245 | */ | 241 | */ |
@@ -314,34 +310,6 @@ void mac_irq_disable(struct irq_data *data) | |||
314 | } | 310 | } |
315 | } | 311 | } |
316 | 312 | ||
317 | int mac_irq_pending(unsigned int irq) | ||
318 | { | ||
319 | switch(IRQ_SRC(irq)) { | ||
320 | case 1: | ||
321 | return via_irq_pending(irq); | ||
322 | case 2: | ||
323 | case 7: | ||
324 | if (oss_present) | ||
325 | return oss_irq_pending(irq); | ||
326 | else | ||
327 | return via_irq_pending(irq); | ||
328 | case 3: | ||
329 | case 5: | ||
330 | case 6: | ||
331 | if (psc_present) | ||
332 | return psc_irq_pending(irq); | ||
333 | else if (oss_present) | ||
334 | return oss_irq_pending(irq); | ||
335 | break; | ||
336 | case 4: | ||
337 | if (psc_present) | ||
338 | return psc_irq_pending(irq); | ||
339 | break; | ||
340 | } | ||
341 | return 0; | ||
342 | } | ||
343 | EXPORT_SYMBOL(mac_irq_pending); | ||
344 | |||
345 | static int num_debug[8]; | 313 | static int num_debug[8]; |
346 | 314 | ||
347 | irqreturn_t mac_debug_handler(int irq, void *dev_id) | 315 | irqreturn_t mac_debug_handler(int irq, void *dev_id) |
diff --git a/arch/m68k/mac/oss.c b/arch/m68k/mac/oss.c index 2344af31e836..a310197a7c7c 100644 --- a/arch/m68k/mac/oss.c +++ b/arch/m68k/mac/oss.c | |||
@@ -219,32 +219,3 @@ void oss_irq_disable(int irq) { | |||
219 | #endif | 219 | #endif |
220 | } | 220 | } |
221 | } | 221 | } |
222 | |||
223 | /* | ||
224 | * Check to see if a specific OSS interrupt is pending | ||
225 | */ | ||
226 | |||
227 | int oss_irq_pending(int irq) | ||
228 | { | ||
229 | switch(irq) { | ||
230 | case IRQ_MAC_SCC: | ||
231 | return oss->irq_pending & OSS_IP_IOPSCC; | ||
232 | break; | ||
233 | case IRQ_MAC_ADB: | ||
234 | return oss->irq_pending & OSS_IP_IOPISM; | ||
235 | break; | ||
236 | case IRQ_MAC_SCSI: | ||
237 | return oss->irq_pending & OSS_IP_SCSI; | ||
238 | break; | ||
239 | case IRQ_NUBUS_9: | ||
240 | case IRQ_NUBUS_A: | ||
241 | case IRQ_NUBUS_B: | ||
242 | case IRQ_NUBUS_C: | ||
243 | case IRQ_NUBUS_D: | ||
244 | case IRQ_NUBUS_E: | ||
245 | irq -= NUBUS_SOURCE_BASE; | ||
246 | return oss->irq_pending & (1 << irq); | ||
247 | break; | ||
248 | } | ||
249 | return 0; | ||
250 | } | ||
diff --git a/arch/m68k/mac/psc.c b/arch/m68k/mac/psc.c index 8dd71c555e93..6f026fc302fa 100644 --- a/arch/m68k/mac/psc.c +++ b/arch/m68k/mac/psc.c | |||
@@ -180,12 +180,3 @@ void psc_irq_disable(int irq) { | |||
180 | #endif | 180 | #endif |
181 | psc_write_byte(pIER, 1 << irq_idx); | 181 | psc_write_byte(pIER, 1 << irq_idx); |
182 | } | 182 | } |
183 | |||
184 | int psc_irq_pending(int irq) | ||
185 | { | ||
186 | int irq_src = IRQ_SRC(irq); | ||
187 | int irq_idx = IRQ_IDX(irq); | ||
188 | int pIFR = pIERbase + (irq_src << 4); | ||
189 | |||
190 | return psc_read_byte(pIFR) & (1 << irq_idx); | ||
191 | } | ||
diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c index 1c2bce7506b2..105707aa03a2 100644 --- a/arch/m68k/mac/via.c +++ b/arch/m68k/mac/via.c | |||
@@ -585,28 +585,6 @@ void via_irq_disable(int irq) { | |||
585 | } | 585 | } |
586 | } | 586 | } |
587 | 587 | ||
588 | /* | ||
589 | * Returns nonzero if an interrupt is pending on the given | ||
590 | * VIA/IRQ combination. | ||
591 | */ | ||
592 | |||
593 | int via_irq_pending(int irq) | ||
594 | { | ||
595 | int irq_src = IRQ_SRC(irq); | ||
596 | int irq_idx = IRQ_IDX(irq); | ||
597 | int irq_bit = 1 << irq_idx; | ||
598 | |||
599 | if (irq_src == 1) { | ||
600 | return via1[vIFR] & irq_bit; | ||
601 | } else if (irq_src == 2) { | ||
602 | return via2[gIFR] & irq_bit; | ||
603 | } else if (irq_src == 7) { | ||
604 | /* Always 0 for MAC_VIA_QUADRA if the slot irq is disabled. */ | ||
605 | return ~via2[gBufA] & irq_bit; | ||
606 | } | ||
607 | return 0; | ||
608 | } | ||
609 | |||
610 | void via1_set_head(int head) | 588 | void via1_set_head(int head) |
611 | { | 589 | { |
612 | if (head == 0) | 590 | if (head == 0) |
@@ -615,3 +593,9 @@ void via1_set_head(int head) | |||
615 | via1[vBufA] |= VIA1A_vHeadSel; | 593 | via1[vBufA] |= VIA1A_vHeadSel; |
616 | } | 594 | } |
617 | EXPORT_SYMBOL(via1_set_head); | 595 | EXPORT_SYMBOL(via1_set_head); |
596 | |||
597 | int via2_scsi_drq_pending(void) | ||
598 | { | ||
599 | return via2[gIFR] & (1 << IRQ_IDX(IRQ_MAC_SCSIDRQ)); | ||
600 | } | ||
601 | EXPORT_SYMBOL(via2_scsi_drq_pending); | ||