aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/hpt366.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci/hpt366.c')
-rw-r--r--drivers/ide/pci/hpt366.c41
1 files changed, 11 insertions, 30 deletions
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c
index 8812a9bb032f..fcb21ddab2cc 100644
--- a/drivers/ide/pci/hpt366.c
+++ b/drivers/ide/pci/hpt366.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/drivers/ide/pci/hpt366.c Version 1.13 Sep 29, 2007 2 * linux/drivers/ide/pci/hpt366.c Version 1.14 Oct 1, 2007
3 * 3 *
4 * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org> 4 * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org>
5 * Portions Copyright (C) 2001 Sun Microsystems, Inc. 5 * Portions Copyright (C) 2001 Sun Microsystems, Inc.
@@ -713,19 +713,6 @@ static void hpt3xx_maskproc(ide_drive_t *drive, int mask)
713 IDE_CONTROL_REG); 713 IDE_CONTROL_REG);
714} 714}
715 715
716static int hpt366_config_drive_xfer_rate(ide_drive_t *drive)
717{
718 drive->init_speed = 0;
719
720 if (ide_tune_dma(drive))
721 return 0;
722
723 if (ide_use_fast_pio(drive))
724 ide_set_max_pio(drive);
725
726 return -1;
727}
728
729/* 716/*
730 * This is specific to the HPT366 UDMA chipset 717 * This is specific to the HPT366 UDMA chipset
731 * by HighPoint|Triones Technologies, Inc. 718 * by HighPoint|Triones Technologies, Inc.
@@ -1304,10 +1291,10 @@ static void __devinit init_hwif_hpt366(ide_hwif_t *hwif)
1304 if (new_mcr != old_mcr) 1291 if (new_mcr != old_mcr)
1305 pci_write_config_byte(dev, hwif->select_data + 1, new_mcr); 1292 pci_write_config_byte(dev, hwif->select_data + 1, new_mcr);
1306 1293
1307 if (!hwif->dma_base) { 1294 hwif->drives[0].autotune = hwif->drives[1].autotune = 1;
1308 hwif->drives[0].autotune = hwif->drives[1].autotune = 1; 1295
1296 if (hwif->dma_base == 0)
1309 return; 1297 return;
1310 }
1311 1298
1312 hwif->ultra_mask = hwif->cds->udma_mask; 1299 hwif->ultra_mask = hwif->cds->udma_mask;
1313 hwif->mwdma_mask = 0x07; 1300 hwif->mwdma_mask = 0x07;
@@ -1349,8 +1336,6 @@ static void __devinit init_hwif_hpt366(ide_hwif_t *hwif)
1349 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 1336 if (hwif->cbl != ATA_CBL_PATA40_SHORT)
1350 hwif->cbl = (scr1 & ata66) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; 1337 hwif->cbl = (scr1 & ata66) ? ATA_CBL_PATA40 : ATA_CBL_PATA80;
1351 1338
1352 hwif->ide_dma_check = &hpt366_config_drive_xfer_rate;
1353
1354 if (chip_type >= HPT374) { 1339 if (chip_type >= HPT374) {
1355 hwif->ide_dma_test_irq = &hpt374_ide_dma_test_irq; 1340 hwif->ide_dma_test_irq = &hpt374_ide_dma_test_irq;
1356 hwif->ide_dma_end = &hpt374_ide_dma_end; 1341 hwif->ide_dma_end = &hpt374_ide_dma_end;
@@ -1360,10 +1345,6 @@ static void __devinit init_hwif_hpt366(ide_hwif_t *hwif)
1360 hwif->dma_timeout = &hpt370_dma_timeout; 1345 hwif->dma_timeout = &hpt370_dma_timeout;
1361 } else 1346 } else
1362 hwif->dma_lost_irq = &hpt366_dma_lost_irq; 1347 hwif->dma_lost_irq = &hpt366_dma_lost_irq;
1363
1364 if (!noautodma)
1365 hwif->autodma = 1;
1366 hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma;
1367} 1348}
1368 1349
1369static void __devinit init_dma_hpt366(ide_hwif_t *hwif, unsigned long dmabase) 1350static void __devinit init_dma_hpt366(ide_hwif_t *hwif, unsigned long dmabase)
@@ -1657,13 +1638,13 @@ static int __devinit hpt366_init_one(struct pci_dev *dev, const struct pci_devic
1657 return d.init_setup(dev, &d); 1638 return d.init_setup(dev, &d);
1658} 1639}
1659 1640
1660static struct pci_device_id hpt366_pci_tbl[] = { 1641static const struct pci_device_id hpt366_pci_tbl[] = {
1661 { PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT366, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 1642 { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT366), 0 },
1662 { PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT372, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, 1643 { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT372), 1 },
1663 { PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT302, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2}, 1644 { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT302), 2 },
1664 { PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT371, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3}, 1645 { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT371), 3 },
1665 { PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT374, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4}, 1646 { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT374), 4 },
1666 { PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT372N, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5}, 1647 { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT372N), 5 },
1667 { 0, }, 1648 { 0, },
1668}; 1649};
1669MODULE_DEVICE_TABLE(pci, hpt366_pci_tbl); 1650MODULE_DEVICE_TABLE(pci, hpt366_pci_tbl);