aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/ata_piix.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2006-10-10 17:28:11 -0400
committerJeff Garzik <jeff@garzik.org>2006-12-01 22:40:25 -0500
commitfc085150b491bfc186efbca90a14cf907a3060a9 (patch)
treeb5bf8b6eb6d0dabd8699e6b41c239619590659e2 /drivers/ata/ata_piix.c
parent2f27ce03628acdb81ead4abe914c713e04a3229e (diff)
[PATCH] libata: add 40pin "short" cable support, honour drive side speed detection
[deweerdt@free.fr: build fix] Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Frederik Deweerdt <deweerdt@free.fr> Cc: Tejun Heo <htejun@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/ata_piix.c')
-rw-r--r--drivers/ata/ata_piix.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 720174d628fa..14b726b9f985 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -93,7 +93,7 @@
93#include <linux/libata.h> 93#include <linux/libata.h>
94 94
95#define DRV_NAME "ata_piix" 95#define DRV_NAME "ata_piix"
96#define DRV_VERSION "2.00ac6" 96#define DRV_VERSION "2.00ac7"
97 97
98enum { 98enum {
99 PIIX_IOCFG = 0x54, /* IDE I/O configuration register */ 99 PIIX_IOCFG = 0x54, /* IDE I/O configuration register */
@@ -571,6 +571,23 @@ module_param(force_pcs, int, 0444);
571MODULE_PARM_DESC(force_pcs, "force honoring or ignoring PCS to work around " 571MODULE_PARM_DESC(force_pcs, "force honoring or ignoring PCS to work around "
572 "device mis-detection (0=default, 1=ignore PCS, 2=honor PCS)"); 572 "device mis-detection (0=default, 1=ignore PCS, 2=honor PCS)");
573 573
574struct ich_laptop {
575 u16 device;
576 u16 subvendor;
577 u16 subdevice;
578};
579
580/*
581 * List of laptops that use short cables rather than 80 wire
582 */
583
584static const struct ich_laptop ich_laptop[] = {
585 /* devid, subvendor, subdev */
586 { 0x27DF, 0x0005, 0x0280 }, /* ICH7 on Acer 5602WLMi */
587 /* end marker */
588 { 0, }
589};
590
574/** 591/**
575 * piix_pata_cbl_detect - Probe host controller cable detect info 592 * piix_pata_cbl_detect - Probe host controller cable detect info
576 * @ap: Port for which cable detect info is desired 593 * @ap: Port for which cable detect info is desired
@@ -585,12 +602,24 @@ MODULE_PARM_DESC(force_pcs, "force honoring or ignoring PCS to work around "
585static void ich_pata_cbl_detect(struct ata_port *ap) 602static void ich_pata_cbl_detect(struct ata_port *ap)
586{ 603{
587 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 604 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
605 const struct ich_laptop *lap = &ich_laptop[0];
588 u8 tmp, mask; 606 u8 tmp, mask;
589 607
590 /* no 80c support in host controller? */ 608 /* no 80c support in host controller? */
591 if ((ap->udma_mask & ~ATA_UDMA_MASK_40C) == 0) 609 if ((ap->udma_mask & ~ATA_UDMA_MASK_40C) == 0)
592 goto cbl40; 610 goto cbl40;
593 611
612 /* Check for specials - Acer Aspire 5602WLMi */
613 while (lap->device) {
614 if (lap->device == pdev->device &&
615 lap->subvendor == pdev->subsystem_vendor &&
616 lap->subdevice == pdev->subsystem_device) {
617 ap->cbl = ATA_CBL_PATA40_SHORT;
618 return;
619 }
620 lap++;
621 }
622
594 /* check BIOS cable detect results */ 623 /* check BIOS cable detect results */
595 mask = ap->port_no == 0 ? PIIX_80C_PRI : PIIX_80C_SEC; 624 mask = ap->port_no == 0 ? PIIX_80C_PRI : PIIX_80C_SEC;
596 pci_read_config_byte(pdev, PIIX_IOCFG, &tmp); 625 pci_read_config_byte(pdev, PIIX_IOCFG, &tmp);