aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/ns87415.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci/ns87415.c')
-rw-r--r--drivers/ide/pci/ns87415.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/ide/pci/ns87415.c b/drivers/ide/pci/ns87415.c
index 45ba71a7182f..9ffdbb89df5c 100644
--- a/drivers/ide/pci/ns87415.c
+++ b/drivers/ide/pci/ns87415.c
@@ -63,6 +63,11 @@ static u8 superio_ide_inb (unsigned long port)
63 return inb(port); 63 return inb(port);
64} 64}
65 65
66static u8 superio_read_sff_dma_status(ide_hwif_t *hwif)
67{
68 return superio_ide_inb(hwif->dma_status);
69}
70
66static void superio_tf_read(ide_drive_t *drive, ide_task_t *task) 71static void superio_tf_read(ide_drive_t *drive, ide_task_t *task)
67{ 72{
68 struct ide_io_ports *io_ports = &drive->hwif->io_ports; 73 struct ide_io_ports *io_ports = &drive->hwif->io_ports;
@@ -122,6 +127,8 @@ static void __devinit superio_ide_init_iops (struct hwif_s *hwif)
122 tmp = superio_ide_inb(superio_ide_dma_status[port]); 127 tmp = superio_ide_inb(superio_ide_dma_status[port]);
123 outb(tmp | 0x66, superio_ide_dma_status[port]); 128 outb(tmp | 0x66, superio_ide_dma_status[port]);
124 129
130 hwif->read_sff_dma_status = superio_read_sff_dma_status;
131
125 hwif->tf_read = superio_tf_read; 132 hwif->tf_read = superio_tf_read;
126 133
127 /* We need to override inb to workaround a SuperIO errata */ 134 /* We need to override inb to workaround a SuperIO errata */
@@ -200,13 +207,13 @@ static int ns87415_dma_end(ide_drive_t *drive)
200 u8 dma_stat = 0, dma_cmd = 0; 207 u8 dma_stat = 0, dma_cmd = 0;
201 208
202 drive->waiting_for_dma = 0; 209 drive->waiting_for_dma = 0;
203 dma_stat = hwif->INB(hwif->dma_status); 210 dma_stat = hwif->read_sff_dma_status(hwif);
204 /* get dma command mode */ 211 /* get dma command mode */
205 dma_cmd = hwif->INB(hwif->dma_command); 212 dma_cmd = inb(hwif->dma_command);
206 /* stop DMA */ 213 /* stop DMA */
207 outb(dma_cmd & ~1, hwif->dma_command); 214 outb(dma_cmd & ~1, hwif->dma_command);
208 /* from ERRATA: clear the INTR & ERROR bits */ 215 /* from ERRATA: clear the INTR & ERROR bits */
209 dma_cmd = hwif->INB(hwif->dma_command); 216 dma_cmd = inb(hwif->dma_command);
210 outb(dma_cmd | 6, hwif->dma_command); 217 outb(dma_cmd | 6, hwif->dma_command);
211 /* and free any DMA resources */ 218 /* and free any DMA resources */
212 ide_destroy_dmatable(drive); 219 ide_destroy_dmatable(drive);