aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ata/pata_atiixp.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/ata/pata_atiixp.c b/drivers/ata/pata_atiixp.c
index 6f6672c55131..504e1dbfffd7 100644
--- a/drivers/ata/pata_atiixp.c
+++ b/drivers/ata/pata_atiixp.c
@@ -36,15 +36,22 @@ enum {
36static int atiixp_pre_reset(struct ata_port *ap) 36static int atiixp_pre_reset(struct ata_port *ap)
37{ 37{
38 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 38 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
39 static struct pci_bits atiixp_enable_bits[] = { 39 static const struct pci_bits atiixp_enable_bits[] = {
40 { 0x48, 1, 0x01, 0x00 }, 40 { 0x48, 1, 0x01, 0x00 },
41 { 0x48, 1, 0x08, 0x00 } 41 { 0x48, 1, 0x08, 0x00 }
42 }; 42 };
43 u8 udma;
43 44
44 if (!pci_test_config_bits(pdev, &atiixp_enable_bits[ap->port_no])) 45 if (!pci_test_config_bits(pdev, &atiixp_enable_bits[ap->port_no]))
45 return -ENOENT; 46 return -ENOENT;
46 47
47 ap->cbl = ATA_CBL_PATA80; 48 /* Hack from drivers/ide/pci. Really we want to know how to do the
49 raw detection not play follow the bios mode guess */
50 pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ap->port_no, &udma);
51 if ((udma & 0x07) >= 0x04 || (udma & 0x70) >= 0x40)
52 ap->cbl = ATA_CBL_PATA80;
53 else
54 ap->cbl = ATA_CBL_PATA40;
48 return ata_std_prereset(ap); 55 return ata_std_prereset(ap);
49} 56}
50 57