/* AMD controller/BIOS setups record the cable type in word 0x42  */
static int amd_cable_detect(struct ata_port *ap)
/* AMD controller/BIOS setups record the cable type in word 0x42  */
static int amd_cable_detect(struct ata_port *ap)
{
	static const u32 bitmask[2] = {0x03, 0x0C};
	struct pci_dev *pdev = to_pci_dev(ap->host->dev);
	u8 ata66;
	pci_read_config_byte(pdev, 0x42, &ata66);
	if (ata66 & bitmask[ap->port_no])
		return ATA_CBL_PATA80;
	return ATA_CBL_PATA40;
}