]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
libata-acpi: add ATA_FLAG_ACPI_SATA port flag
authorTejun Heo <htejun@gmail.com>
Mon, 14 May 2007 18:28:15 +0000 (03:28 +0900)
committerJeff Garzik <jeff@garzik.org>
Wed, 16 May 2007 05:18:31 +0000 (01:18 -0400)
Whether a controller needs IDE or SATA ACPI hierarchy is determined by
the programming interface of the controller not by whether the
controller is SATA or PATA, or it supports slave device or not.  This
patch adds ATA_FLAG_ACPI_SATA port flags which tells libata-acpi that
the port needs SATA ACPI nodes, and sets the flag for ahci and
sata_sil24.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/ata/ahci.c
drivers/ata/libata-acpi.c
drivers/ata/sata_sil24.c
include/linux/libata.h

index 1ae443d7ab92223335631a430fc77c948bb7aa8b..e00e1b913d28b5501dbe700d1b4511c328353f13 100644 (file)
@@ -173,7 +173,8 @@ enum {
 
        AHCI_FLAG_COMMON                = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
                                          ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
-                                         ATA_FLAG_SKIP_D2H_BSY,
+                                         ATA_FLAG_SKIP_D2H_BSY |
+                                         ATA_FLAG_ACPI_SATA,
 };
 
 struct ahci_cmd_hdr {
index ed4138e24b0c3bdeae22b64c12421725ac13ee85..02236739b40f73787dfbd5cb40204117dd44be6f 100644 (file)
@@ -321,7 +321,7 @@ static int do_drive_get_GTF(struct ata_device *dev, unsigned int *gtf_length,
 
        /* Don't continue if device has no _ADR method.
         * _GTF is intended for known motherboard devices. */
-       if (!(ap->cbl == ATA_CBL_SATA)) {
+       if (!(ap->flags & ATA_FLAG_ACPI_SATA)) {
                err = pata_get_dev_handle(gdev, &dev_handle, &pcidevfn);
                if (err < 0) {
                        if (ata_msg_probe(ap))
@@ -343,7 +343,7 @@ static int do_drive_get_GTF(struct ata_device *dev, unsigned int *gtf_length,
 
        /* Get this drive's _ADR info. if not already known. */
        if (!dev->obj_handle) {
-               if (!(ap->cbl == ATA_CBL_SATA)) {
+               if (!(ap->flags & ATA_FLAG_ACPI_SATA)) {
                        /* get child objects of dev_handle == channel objects,
                         * + _their_ children == drive objects */
                        /* channel is ap->port_no */
@@ -528,7 +528,7 @@ static int do_drive_set_taskfiles(struct ata_device *dev,
                ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER: port#: %d\n",
                               __FUNCTION__, ap->port_no);
 
-       if (libata_noacpi || !(ap->cbl == ATA_CBL_SATA))
+       if (libata_noacpi || !(ap->flags & ATA_FLAG_ACPI_SATA))
                return 0;
 
        if (!ata_dev_enabled(dev) || (ap->flags & ATA_FLAG_DISABLED))
@@ -578,7 +578,7 @@ int ata_acpi_exec_tfs(struct ata_port *ap)
         * we should not run GTF on PATA devices since some
         * PATA require execution of GTM/STM before GTF.
         */
-       if (!(ap->cbl == ATA_CBL_SATA))
+       if (!(ap->flags & ATA_FLAG_ACPI_SATA))
                return 0;
 
        for (ix = 0; ix < ATA_MAX_DEVICES; ix++) {
@@ -641,7 +641,7 @@ int ata_acpi_push_id(struct ata_device *dev)
                               __FUNCTION__, dev->devno, ap->port_no);
 
        /* Don't continue if not a SATA device. */
-       if (!(ap->cbl == ATA_CBL_SATA)) {
+       if (!(ap->flags & ATA_FLAG_ACPI_SATA)) {
                if (ata_msg_probe(ap))
                        ata_dev_printk(dev, KERN_DEBUG,
                                "%s: Not a SATA device\n", __FUNCTION__);
index a69d78cd8e9b8e3cd931e764f7d43c2ad6c15587..0cb6618935b159b45aa60851390cfafb1809fa42 100644 (file)
@@ -237,7 +237,8 @@ enum {
        /* host flags */
        SIL24_COMMON_FLAGS      = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
                                  ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
-                                 ATA_FLAG_NCQ | ATA_FLAG_SKIP_D2H_BSY,
+                                 ATA_FLAG_NCQ | ATA_FLAG_SKIP_D2H_BSY |
+                                 ATA_FLAG_ACPI_SATA,
        SIL24_FLAG_PCIX_IRQ_WOC = (1 << 24), /* IRQ loss errata on PCI-X */
 
        IRQ_STAT_4PORTS         = 0xf,
index b38a0f9bc9f758e206b743bd9450d39dba98e38e..9b2122db30ff25e6a487f3c8c0e6f53a9e838cdf 100644 (file)
@@ -173,6 +173,7 @@ enum {
        ATA_FLAG_SETXFER_POLLING= (1 << 14), /* use polling for SETXFER */
        ATA_FLAG_IGN_SIMPLEX    = (1 << 15), /* ignore SIMPLEX */
        ATA_FLAG_NO_IORDY       = (1 << 16), /* controller lacks iordy */
+       ATA_FLAG_ACPI_SATA      = (1 << 17), /* need native SATA ACPI layout */
 
        /* The following flag belongs to ap->pflags but is kept in
         * ap->flags because it's referenced in many LLDs and will be