-/* pdc_reset_port(ap); */ /* pata fix */
-/* sata_phy_reset(ap); */ /* pata fix */
- /* if no sata flag, test for pata drive */ /* pata fix */
- if (ap->flags & ATA_FLAG_SATA) /* pata fix */
- { /* pata fix */
- pdc_reset_port(ap); /* pata fix */
- sata_phy_reset(ap); /* pata fix */
- } /* pata fix */
- else /* pata fix */
- pdc_pata_phy_reset(ap); /* pata fix */
+ /* pdc_reset_port(ap); */ /* pata fix */
+ /* sata_phy_reset(ap); */ /* pata fix */
+ /* if no sata flag, test for pata drive */ /* pata fix */
+ if (ap->flags & ATA_FLAG_SATA) /* pata fix */
+ { /* pata fix */
+ pdc_reset_port(ap); /* pata fix */
+ sata_phy_reset(ap); /* pata fix */
+ } /* pata fix */
+ else /* pata fix */
+ pdc_pata_phy_reset(ap); /* pata fix */
+}
+
+static void pdc_pata_cbl_detect(struct ata_port *ap)
+{
+ u8 tmp;
+ void __iomem *mmio = (void *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03;
+
+ tmp = readb(mmio);
+
+ if (tmp & 0x01) {
+ ap->cbl = ATA_CBL_PATA40;
+ ap->udma_mask &= ATA_UDMA_MASK_40C;
+ } else
+ ap->cbl = ATA_CBL_PATA80;