diff options
Diffstat (limited to 'drivers/ide/pci/hpt366.c')
-rw-r--r-- | drivers/ide/pci/hpt366.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c index 397c6cbe953c..1f1135ce7cd6 100644 --- a/drivers/ide/pci/hpt366.c +++ b/drivers/ide/pci/hpt366.c | |||
@@ -801,9 +801,9 @@ static void hpt370_irq_timeout(ide_drive_t *drive) | |||
801 | printk(KERN_DEBUG "%s: %d bytes in FIFO\n", drive->name, bfifo & 0x1ff); | 801 | printk(KERN_DEBUG "%s: %d bytes in FIFO\n", drive->name, bfifo & 0x1ff); |
802 | 802 | ||
803 | /* get DMA command mode */ | 803 | /* get DMA command mode */ |
804 | dma_cmd = inb(hwif->dma_command); | 804 | dma_cmd = inb(hwif->dma_base + ATA_DMA_CMD); |
805 | /* stop DMA */ | 805 | /* stop DMA */ |
806 | outb(dma_cmd & ~0x1, hwif->dma_command); | 806 | outb(dma_cmd & ~0x1, hwif->dma_base + ATA_DMA_CMD); |
807 | hpt370_clear_engine(drive); | 807 | hpt370_clear_engine(drive); |
808 | } | 808 | } |
809 | 809 | ||
@@ -818,12 +818,12 @@ static void hpt370_dma_start(ide_drive_t *drive) | |||
818 | static int hpt370_dma_end(ide_drive_t *drive) | 818 | static int hpt370_dma_end(ide_drive_t *drive) |
819 | { | 819 | { |
820 | ide_hwif_t *hwif = HWIF(drive); | 820 | ide_hwif_t *hwif = HWIF(drive); |
821 | u8 dma_stat = inb(hwif->dma_status); | 821 | u8 dma_stat = inb(hwif->dma_base + ATA_DMA_STATUS); |
822 | 822 | ||
823 | if (dma_stat & 0x01) { | 823 | if (dma_stat & 0x01) { |
824 | /* wait a little */ | 824 | /* wait a little */ |
825 | udelay(20); | 825 | udelay(20); |
826 | dma_stat = inb(hwif->dma_status); | 826 | dma_stat = inb(hwif->dma_base + ATA_DMA_STATUS); |
827 | if (dma_stat & 0x01) | 827 | if (dma_stat & 0x01) |
828 | hpt370_irq_timeout(drive); | 828 | hpt370_irq_timeout(drive); |
829 | } | 829 | } |
@@ -850,7 +850,7 @@ static int hpt374_dma_test_irq(ide_drive_t *drive) | |||
850 | return 0; | 850 | return 0; |
851 | } | 851 | } |
852 | 852 | ||
853 | dma_stat = inb(hwif->dma_status); | 853 | dma_stat = inb(hwif->dma_base + ATA_DMA_STATUS); |
854 | /* return 1 if INTR asserted */ | 854 | /* return 1 if INTR asserted */ |
855 | if (dma_stat & 4) | 855 | if (dma_stat & 4) |
856 | return 1; | 856 | return 1; |
@@ -1320,7 +1320,15 @@ static int __devinit init_dma_hpt366(ide_hwif_t *hwif, | |||
1320 | unsigned long flags, base = ide_pci_dma_base(hwif, d); | 1320 | unsigned long flags, base = ide_pci_dma_base(hwif, d); |
1321 | u8 dma_old, dma_new, masterdma = 0, slavedma = 0; | 1321 | u8 dma_old, dma_new, masterdma = 0, slavedma = 0; |
1322 | 1322 | ||
1323 | if (base == 0 || ide_pci_set_master(dev, d->name) < 0) | 1323 | if (base == 0) |
1324 | return -1; | ||
1325 | |||
1326 | hwif->dma_base = base; | ||
1327 | |||
1328 | if (ide_pci_check_simplex(hwif, d) < 0) | ||
1329 | return -1; | ||
1330 | |||
1331 | if (ide_pci_set_master(dev, d->name) < 0) | ||
1324 | return -1; | 1332 | return -1; |
1325 | 1333 | ||
1326 | dma_old = inb(base + 2); | 1334 | dma_old = inb(base + 2); |
@@ -1346,7 +1354,7 @@ static int __devinit init_dma_hpt366(ide_hwif_t *hwif, | |||
1346 | if (ide_allocate_dma_engine(hwif)) | 1354 | if (ide_allocate_dma_engine(hwif)) |
1347 | return -1; | 1355 | return -1; |
1348 | 1356 | ||
1349 | ide_setup_dma(hwif, base); | 1357 | hwif->dma_ops = &sff_dma_ops; |
1350 | 1358 | ||
1351 | return 0; | 1359 | return 0; |
1352 | } | 1360 | } |
@@ -1401,7 +1409,6 @@ static int __devinit hpt36x_init(struct pci_dev *dev, struct pci_dev *dev2) | |||
1401 | 1409 | ||
1402 | #define IDE_HFLAGS_HPT3XX \ | 1410 | #define IDE_HFLAGS_HPT3XX \ |
1403 | (IDE_HFLAG_NO_ATAPI_DMA | \ | 1411 | (IDE_HFLAG_NO_ATAPI_DMA | \ |
1404 | IDE_HFLAG_ABUSE_SET_DMA_MODE | \ | ||
1405 | IDE_HFLAG_OFF_BOARD) | 1412 | IDE_HFLAG_OFF_BOARD) |
1406 | 1413 | ||
1407 | static const struct ide_port_ops hpt3xx_port_ops = { | 1414 | static const struct ide_port_ops hpt3xx_port_ops = { |