aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/pdc202xx_old.c39
1 files changed, 2 insertions, 37 deletions
diff --git a/drivers/ide/pdc202xx_old.c b/drivers/ide/pdc202xx_old.c
index b3bc96f930a6..668f452d74e9 100644
--- a/drivers/ide/pdc202xx_old.c
+++ b/drivers/ide/pdc202xx_old.c
@@ -203,30 +203,6 @@ static int pdc202xx_dma_end(ide_drive_t *drive)
203 return ide_dma_end(drive); 203 return ide_dma_end(drive);
204} 204}
205 205
206static int pdc202xx_dma_test_irq(ide_drive_t *drive)
207{
208 ide_hwif_t *hwif = drive->hwif;
209 unsigned long high_16 = hwif->extra_base - 16;
210 u8 dma_stat = inb(hwif->dma_base + ATA_DMA_STATUS);
211 u8 sc1d = inb(high_16 + 0x001d);
212
213 if (hwif->channel) {
214 /* bit7: Error, bit6: Interrupting, bit5: FIFO Full, bit4: FIFO Empty */
215 if ((sc1d & 0x50) == 0x50)
216 goto somebody_else;
217 else if ((sc1d & 0x40) == 0x40)
218 return (dma_stat & 4) == 4;
219 } else {
220 /* bit3: Error, bit2: Interrupting, bit1: FIFO Full, bit0: FIFO Empty */
221 if ((sc1d & 0x05) == 0x05)
222 goto somebody_else;
223 else if ((sc1d & 0x04) == 0x04)
224 return (dma_stat & 4) == 4;
225 }
226somebody_else:
227 return (dma_stat & 4) == 4; /* return 1 if INTR asserted */
228}
229
230static void pdc202xx_reset(ide_drive_t *drive) 206static void pdc202xx_reset(ide_drive_t *drive)
231{ 207{
232 ide_hwif_t *hwif = drive->hwif; 208 ide_hwif_t *hwif = drive->hwif;
@@ -313,23 +289,12 @@ static const struct ide_port_ops pdc2026x_port_ops = {
313 .cable_detect = pdc2026x_cable_detect, 289 .cable_detect = pdc2026x_cable_detect,
314}; 290};
315 291
316static const struct ide_dma_ops pdc20246_dma_ops = {
317 .dma_host_set = ide_dma_host_set,
318 .dma_setup = ide_dma_setup,
319 .dma_start = ide_dma_start,
320 .dma_end = ide_dma_end,
321 .dma_test_irq = pdc202xx_dma_test_irq,
322 .dma_lost_irq = ide_dma_lost_irq,
323 .dma_timer_expiry = ide_dma_sff_timer_expiry,
324 .dma_sff_read_status = ide_dma_sff_read_status,
325};
326
327static const struct ide_dma_ops pdc2026x_dma_ops = { 292static const struct ide_dma_ops pdc2026x_dma_ops = {
328 .dma_host_set = ide_dma_host_set, 293 .dma_host_set = ide_dma_host_set,
329 .dma_setup = ide_dma_setup, 294 .dma_setup = ide_dma_setup,
330 .dma_start = pdc202xx_dma_start, 295 .dma_start = pdc202xx_dma_start,
331 .dma_end = pdc202xx_dma_end, 296 .dma_end = pdc202xx_dma_end,
332 .dma_test_irq = pdc202xx_dma_test_irq, 297 .dma_test_irq = ide_dma_test_irq,
333 .dma_lost_irq = pdc202xx_dma_lost_irq, 298 .dma_lost_irq = pdc202xx_dma_lost_irq,
334 .dma_timer_expiry = ide_dma_sff_timer_expiry, 299 .dma_timer_expiry = ide_dma_sff_timer_expiry,
335 .dma_clear = pdc202xx_reset, 300 .dma_clear = pdc202xx_reset,
@@ -354,7 +319,7 @@ static const struct ide_port_info pdc202xx_chipsets[] __devinitdata = {
354 .name = DRV_NAME, 319 .name = DRV_NAME,
355 .init_chipset = init_chipset_pdc202xx, 320 .init_chipset = init_chipset_pdc202xx,
356 .port_ops = &pdc20246_port_ops, 321 .port_ops = &pdc20246_port_ops,
357 .dma_ops = &pdc20246_dma_ops, 322 .dma_ops = &sff_dma_ops,
358 .host_flags = IDE_HFLAGS_PDC202XX, 323 .host_flags = IDE_HFLAGS_PDC202XX,
359 .pio_mask = ATA_PIO4, 324 .pio_mask = ATA_PIO4,
360 .mwdma_mask = ATA_MWDMA2, 325 .mwdma_mask = ATA_MWDMA2,