/* Perform cable detection for C2 and later revisions  */
static int ali_c2_cable_detect(struct ata_port *ap)
/* Perform cable detection for C2 and later revisions  */
static int ali_c2_cable_detect(struct ata_port *ap)
{
	struct pci_dev *pdev = to_pci_dev(ap->host->dev);
	u8 ata66;
	if (ali_cable_override(pdev))
		return ATA_CBL_PATA40_SHORT;
	pci_read_config_byte(pdev, 0x4A, &ata66);
	if (ata66 & (1 << ap->port_no))
		return ATA_CBL_PATA40;
	else
		return ATA_CBL_PATA80;
}