From f5a0524658e9761d2119de07e91198af66b75ef1 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Mon, 9 Jul 2007 23:17:58 +0200 Subject: [PATCH] --- yaml --- r: 58335 b: refs/heads/master c: bdab00b73d2f77075a3c73556e2692bf06849c17 h: refs/heads/master i: 58333: 40a27f87f1b8daefa762d53c7a648df86565b375 58331: 8b367b5476e3a9b631fc089f673627186cdb80da 58327: 94b431fffcffaa8874521cef6b7d68b172034829 58319: 8ab88dfe903032f96d4e941af169a14ebbca8bb7 58303: 5133c858f16f14c0d162a724e6b26a77bc33508f v: v3 --- [refs] | 2 +- trunk/drivers/ide/pci/via82cxxx.c | 48 ++++++++++++++++++++++++++----- 2 files changed, 42 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index d0ead12fb2bc..e17460f553d0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f2befd9e80b39a5aa54d65cf59b6a5feb9a8117e +refs/heads/master: bdab00b73d2f77075a3c73556e2692bf06849c17 diff --git a/trunk/drivers/ide/pci/via82cxxx.c b/trunk/drivers/ide/pci/via82cxxx.c index ae88e9f65921..d21dd2e7eeb3 100644 --- a/trunk/drivers/ide/pci/via82cxxx.c +++ b/trunk/drivers/ide/pci/via82cxxx.c @@ -1,6 +1,6 @@ /* * - * Version 3.40 + * Version 3.45 * * VIA IDE driver for Linux. Supported southbridges: * @@ -34,6 +34,8 @@ #include #include #include +#include + #include #ifdef CONFIG_PPC_CHRP @@ -415,6 +417,42 @@ static unsigned int __devinit init_chipset_via82cxxx(struct pci_dev *dev, const return 0; } +/* + * Cable special cases + */ + +static struct dmi_system_id cable_dmi_table[] = { + { + .ident = "Acer Ferrari 3400", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Acer,Inc."), + DMI_MATCH(DMI_BOARD_NAME, "Ferrari 3400"), + }, + }, + { } +}; + +static int via_cable_override(void) +{ + /* Systems by DMI */ + if (dmi_check_system(cable_dmi_table)) + return 1; + return 0; +} + +static u8 __devinit via82cxxx_cable_detect(ide_hwif_t *hwif) +{ + struct via82cxxx_dev *vdev = pci_get_drvdata(hwif->pci_dev); + + if (via_cable_override()) + return ATA_CBL_PATA40_SHORT; + + if ((vdev->via_80w >> hwif->channel) & 1) + return ATA_CBL_PATA80; + else + return ATA_CBL_PATA40; +} + static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif) { struct via82cxxx_dev *vdev = pci_get_drvdata(hwif->pci_dev); @@ -448,12 +486,8 @@ static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif) hwif->mwdma_mask = 0x07; hwif->swdma_mask = 0x07; - if (hwif->cbl != ATA_CBL_PATA40_SHORT) { - if ((vdev->via_80w >> hwif->channel) & 1) - hwif->cbl = ATA_CBL_PATA80; - else - hwif->cbl = ATA_CBL_PATA40; - } + if (hwif->cbl != ATA_CBL_PATA40_SHORT) + hwif->cbl = via82cxxx_cable_detect(hwif); hwif->ide_dma_check = &via82cxxx_ide_dma_check; if (!noautodma)