diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2006-06-25 04:32:25 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-06-26 02:15:01 -0400 |
commit | 350559961593a9680244b22b32733a49e21f25d6 (patch) | |
tree | 587baa8873bfede50fb9d7fdf06176001f2f947f /include/asm-sparc64 | |
parent | 698539187aee83ea6843e29875dde70b473f8bc1 (diff) |
[SPARC64]: Allow floppy driver to build modular.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/asm-sparc64')
-rw-r--r-- | include/asm-sparc64/floppy.h | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h index f8d57bb5570c..b591d0e8d8f0 100644 --- a/include/asm-sparc64/floppy.h +++ b/include/asm-sparc64/floppy.h | |||
@@ -208,7 +208,55 @@ static void sun_fd_enable_dma(void) | |||
208 | pdma_areasize = pdma_size; | 208 | pdma_areasize = pdma_size; |
209 | } | 209 | } |
210 | 210 | ||
211 | extern irqreturn_t sparc_floppy_irq(int, void *, struct pt_regs *); | 211 | irqreturn_t sparc_floppy_irq(int irq, void *dev_cookie, struct pt_regs *regs) |
212 | { | ||
213 | if (likely(doing_pdma)) { | ||
214 | void __iomem *stat = (void __iomem *) fdc_status; | ||
215 | unsigned char *vaddr = pdma_vaddr; | ||
216 | unsigned long size = pdma_size; | ||
217 | u8 val; | ||
218 | |||
219 | while (size) { | ||
220 | val = readb(stat); | ||
221 | if (unlikely(!(val & 0x80))) { | ||
222 | pdma_vaddr = vaddr; | ||
223 | pdma_size = size; | ||
224 | return IRQ_HANDLED; | ||
225 | } | ||
226 | if (unlikely(!(val & 0x20))) { | ||
227 | pdma_vaddr = vaddr; | ||
228 | pdma_size = size; | ||
229 | doing_pdma = 0; | ||
230 | goto main_interrupt; | ||
231 | } | ||
232 | if (val & 0x40) { | ||
233 | /* read */ | ||
234 | *vaddr++ = readb(stat + 1); | ||
235 | } else { | ||
236 | unsigned char data = *vaddr++; | ||
237 | |||
238 | /* write */ | ||
239 | writeb(data, stat + 1); | ||
240 | } | ||
241 | size--; | ||
242 | } | ||
243 | |||
244 | pdma_vaddr = vaddr; | ||
245 | pdma_size = size; | ||
246 | |||
247 | /* Send Terminal Count pulse to floppy controller. */ | ||
248 | val = readb(auxio_register); | ||
249 | val |= AUXIO_AUX1_FTCNT; | ||
250 | writeb(val, auxio_register); | ||
251 | val &= ~AUXIO_AUX1_FTCNT; | ||
252 | writeb(val, auxio_register); | ||
253 | |||
254 | doing_pdma = 0; | ||
255 | } | ||
256 | |||
257 | main_interrupt: | ||
258 | return floppy_interrupt(irq, dev_cookie, regs); | ||
259 | } | ||
212 | 260 | ||
213 | static int sun_fd_request_irq(void) | 261 | static int sun_fd_request_irq(void) |
214 | { | 262 | { |