Commit 54494f3a authored by Alan's avatar Alan Committed by Jeff Garzik

pata_atiixp: propogate cable detection hack from drivers/ide to the new driver

Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 77280989
...@@ -36,15 +36,22 @@ enum { ...@@ -36,15 +36,22 @@ enum {
static int atiixp_pre_reset(struct ata_port *ap) static int atiixp_pre_reset(struct ata_port *ap)
{ {
struct pci_dev *pdev = to_pci_dev(ap->host->dev); struct pci_dev *pdev = to_pci_dev(ap->host->dev);
static struct pci_bits atiixp_enable_bits[] = { static const struct pci_bits atiixp_enable_bits[] = {
{ 0x48, 1, 0x01, 0x00 }, { 0x48, 1, 0x01, 0x00 },
{ 0x48, 1, 0x08, 0x00 } { 0x48, 1, 0x08, 0x00 }
}; };
u8 udma;
if (!pci_test_config_bits(pdev, &atiixp_enable_bits[ap->port_no])) if (!pci_test_config_bits(pdev, &atiixp_enable_bits[ap->port_no]))
return -ENOENT; return -ENOENT;
/* Hack from drivers/ide/pci. Really we want to know how to do the
raw detection not play follow the bios mode guess */
pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ap->port_no, &udma);
if ((udma & 0x07) >= 0x04 || (udma & 0x70) >= 0x40)
ap->cbl = ATA_CBL_PATA80; ap->cbl = ATA_CBL_PATA80;
else
ap->cbl = ATA_CBL_PATA40;
return ata_std_prereset(ap); return ata_std_prereset(ap);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment