Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=54494f3a8339baad5e8f9d9b87d3ea6a3aa4f540
Commit:     54494f3a8339baad5e8f9d9b87d3ea6a3aa4f540
Parent:     77280989673ee1ef736a92617f52e2be45651833
Author:     Alan <[EMAIL PROTECTED]>
AuthorDate: Wed Jan 31 17:10:46 2007 +0000
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Fri Feb 2 11:52:05 2007 -0500

    pata_atiixp: propogate cable detection hack from drivers/ide to the new 
driver
    
    Signed-off-by: Alan Cox <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/ata/pata_atiixp.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/pata_atiixp.c b/drivers/ata/pata_atiixp.c
index 6f6672c..504e1db 100644
--- a/drivers/ata/pata_atiixp.c
+++ b/drivers/ata/pata_atiixp.c
@@ -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);
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to