]> err.no Git - linux-2.6/blobdiff - drivers/scsi/ata_piix.c
[MFD] Add SA11x0 MCP platform device support
[linux-2.6] / drivers / scsi / ata_piix.c
index 54c52349adc53297971c6e04067d931aabf3148d..a2cfade2c1c655b70b0078cdcfbbd1dd050831df 100644 (file)
@@ -38,6 +38,7 @@ enum {
        PIIX_IOCFG              = 0x54, /* IDE I/O configuration register */
        ICH5_PMR                = 0x90, /* port mapping register */
        ICH5_PCS                = 0x92, /* port control and status */
+       PIIX_SCC                = 0x0A, /* sub-class code register */
 
        PIIX_FLAG_AHCI          = (1 << 28), /* AHCI possible */
        PIIX_FLAG_CHECKINTR     = (1 << 29), /* make sure PCI INTx enabled */
@@ -62,6 +63,8 @@ enum {
        ich6_sata_rm            = 4,
        ich7_sata               = 5,
        esb2_sata               = 6,
+
+       PIIX_AHCI_DEVICE        = 6,
 };
 
 static int piix_init_one (struct pci_dev *pdev,
@@ -574,11 +577,11 @@ static int piix_disable_ahci(struct pci_dev *pdev)
        addr = pci_resource_start(pdev, AHCI_PCI_BAR);
        if (!addr || !pci_resource_len(pdev, AHCI_PCI_BAR))
                return 0;
-       
+
        mmio = ioremap(addr, 64);
        if (!mmio)
                return -ENOMEM;
-       
+
        tmp = readl(mmio + AHCI_GLOBAL_CTL);
        if (tmp & AHCI_ENABLE) {
                tmp &= ~AHCI_ENABLE;
@@ -588,7 +591,7 @@ static int piix_disable_ahci(struct pci_dev *pdev)
                if (tmp & AHCI_ENABLE)
                        rc = -EIO;
        }
-       
+
        iounmap(mmio);
        return rc;
 }
@@ -626,9 +629,13 @@ static int piix_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
        port_info[1] = NULL;
 
        if (port_info[0]->host_flags & PIIX_FLAG_AHCI) {
-               int rc = piix_disable_ahci(pdev);
-               if (rc)
-                       return rc;
+               u8 tmp;
+               pci_read_config_byte(pdev, PIIX_SCC, &tmp);
+               if (tmp == PIIX_AHCI_DEVICE) {
+                       int rc = piix_disable_ahci(pdev);
+                       if (rc)
+                           return rc;
+               }
        }
 
        if (port_info[0]->host_flags & PIIX_FLAG_COMBINED) {
@@ -665,15 +672,6 @@ static int piix_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
        return ata_pci_init_one(pdev, port_info, n_ports);
 }
 
-/**
- *     piix_init -
- *
- *     LOCKING:
- *
- *     RETURNS:
- *
- */
-
 static int __init piix_init(void)
 {
        int rc;
@@ -689,13 +687,6 @@ static int __init piix_init(void)
        return 0;
 }
 
-/**
- *     piix_exit -
- *
- *     LOCKING:
- *
- */
-
 static void __exit piix_exit(void)
 {
        pci_unregister_driver(&piix_pci_driver);