diff options
Diffstat (limited to 'drivers/ata/libata-acpi.c')
-rw-r--r-- | drivers/ata/libata-acpi.c | 41 |
1 files changed, 16 insertions, 25 deletions
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index a6f1a6b56d8c..9e8ec19260af 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c | |||
@@ -490,38 +490,29 @@ EXPORT_SYMBOL_GPL(ata_acpi_gtm_xfermask); | |||
490 | /** | 490 | /** |
491 | * ata_acpi_cbl_80wire - Check for 80 wire cable | 491 | * ata_acpi_cbl_80wire - Check for 80 wire cable |
492 | * @ap: Port to check | 492 | * @ap: Port to check |
493 | * @gtm: GTM data to use | ||
493 | * | 494 | * |
494 | * Return 1 if the ACPI mode data for this port indicates the BIOS selected | 495 | * Return 1 if the @gtm indicates the BIOS selected an 80wire mode. |
495 | * an 80wire mode. | ||
496 | */ | 496 | */ |
497 | 497 | int ata_acpi_cbl_80wire(struct ata_port *ap, const struct ata_acpi_gtm *gtm) | |
498 | int ata_acpi_cbl_80wire(struct ata_port *ap) | ||
499 | { | 498 | { |
500 | const struct ata_acpi_gtm *gtm = ata_acpi_init_gtm(ap); | 499 | struct ata_device *dev; |
501 | int valid = 0; | ||
502 | 500 | ||
503 | if (!gtm) | 501 | ata_link_for_each_dev(dev, &ap->link) { |
504 | return 0; | 502 | unsigned long xfer_mask, udma_mask; |
503 | |||
504 | if (!ata_dev_enabled(dev)) | ||
505 | continue; | ||
506 | |||
507 | xfer_mask = ata_acpi_gtm_xfermask(dev, gtm); | ||
508 | ata_unpack_xfermask(xfer_mask, NULL, NULL, &udma_mask); | ||
509 | |||
510 | if (udma_mask & ~ATA_UDMA_MASK_40C) | ||
511 | return 1; | ||
512 | } | ||
505 | 513 | ||
506 | /* Split timing, DMA enabled */ | ||
507 | if ((gtm->flags & 0x11) == 0x11 && gtm->drive[0].dma < 55) | ||
508 | valid |= 1; | ||
509 | if ((gtm->flags & 0x14) == 0x14 && gtm->drive[1].dma < 55) | ||
510 | valid |= 2; | ||
511 | /* Shared timing, DMA enabled */ | ||
512 | if ((gtm->flags & 0x11) == 0x01 && gtm->drive[0].dma < 55) | ||
513 | valid |= 1; | ||
514 | if ((gtm->flags & 0x14) == 0x04 && gtm->drive[0].dma < 55) | ||
515 | valid |= 2; | ||
516 | |||
517 | /* Drive check */ | ||
518 | if ((valid & 1) && ata_dev_enabled(&ap->link.device[0])) | ||
519 | return 1; | ||
520 | if ((valid & 2) && ata_dev_enabled(&ap->link.device[1])) | ||
521 | return 1; | ||
522 | return 0; | 514 | return 0; |
523 | } | 515 | } |
524 | |||
525 | EXPORT_SYMBOL_GPL(ata_acpi_cbl_80wire); | 516 | EXPORT_SYMBOL_GPL(ata_acpi_cbl_80wire); |
526 | 517 | ||
527 | static void ata_acpi_gtf_to_tf(struct ata_device *dev, | 518 | static void ata_acpi_gtf_to_tf(struct ata_device *dev, |