Skip to content

Commit

Permalink
pata_atiixp: propogate cable detection hack from drivers/ide to the n…
Browse files Browse the repository at this point in the history
…ew driver

Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Jeff Garzik <[email protected]>
  • Loading branch information
Alan-Cox authored and Jeff Garzik committed Feb 2, 2007
1 parent 7728098 commit 54494f3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions drivers/ata/pata_atiixp.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,22 @@ enum {
static int atiixp_pre_reset(struct ata_port *ap)
{
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, 0x08, 0x00 }
};
u8 udma;

if (!pci_test_config_bits(pdev, &atiixp_enable_bits[ap->port_no]))
return -ENOENT;

ap->cbl = ATA_CBL_PATA80;
/* 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;
else
ap->cbl = ATA_CBL_PATA40;
return ata_std_prereset(ap);
}

Expand Down

0 comments on commit 54494f3

Please sign in to comment.