diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-07-09 17:17:58 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-07-09 17:17:58 -0400 |
commit | bdab00b73d2f77075a3c73556e2692bf06849c17 (patch) | |
tree | 0ea8db6c990de201487d910bc51ca691f9e3887b /drivers/ide | |
parent | f2befd9e80b39a5aa54d65cf59b6a5feb9a8117e (diff) |
via82cxxx: backport short cables support from pata_via.c
Backport short cables support from pata_via.c.
This patch should allow UDMA > 2 modes on Acer Ferrari 3400.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/pci/via82cxxx.c | 48 |
1 files changed, 41 insertions, 7 deletions
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c index ae88e9f65921..d21dd2e7eeb3 100644 --- a/drivers/ide/pci/via82cxxx.c +++ b/drivers/ide/pci/via82cxxx.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * | 2 | * |
3 | * Version 3.40 | 3 | * Version 3.45 |
4 | * | 4 | * |
5 | * VIA IDE driver for Linux. Supported southbridges: | 5 | * VIA IDE driver for Linux. Supported southbridges: |
6 | * | 6 | * |
@@ -34,6 +34,8 @@ | |||
34 | #include <linux/pci.h> | 34 | #include <linux/pci.h> |
35 | #include <linux/init.h> | 35 | #include <linux/init.h> |
36 | #include <linux/ide.h> | 36 | #include <linux/ide.h> |
37 | #include <linux/dmi.h> | ||
38 | |||
37 | #include <asm/io.h> | 39 | #include <asm/io.h> |
38 | 40 | ||
39 | #ifdef CONFIG_PPC_CHRP | 41 | #ifdef CONFIG_PPC_CHRP |
@@ -415,6 +417,42 @@ static unsigned int __devinit init_chipset_via82cxxx(struct pci_dev *dev, const | |||
415 | return 0; | 417 | return 0; |
416 | } | 418 | } |
417 | 419 | ||
420 | /* | ||
421 | * Cable special cases | ||
422 | */ | ||
423 | |||
424 | static struct dmi_system_id cable_dmi_table[] = { | ||
425 | { | ||
426 | .ident = "Acer Ferrari 3400", | ||
427 | .matches = { | ||
428 | DMI_MATCH(DMI_BOARD_VENDOR, "Acer,Inc."), | ||
429 | DMI_MATCH(DMI_BOARD_NAME, "Ferrari 3400"), | ||
430 | }, | ||
431 | }, | ||
432 | { } | ||
433 | }; | ||
434 | |||
435 | static int via_cable_override(void) | ||
436 | { | ||
437 | /* Systems by DMI */ | ||
438 | if (dmi_check_system(cable_dmi_table)) | ||
439 | return 1; | ||
440 | return 0; | ||
441 | } | ||
442 | |||
443 | static u8 __devinit via82cxxx_cable_detect(ide_hwif_t *hwif) | ||
444 | { | ||
445 | struct via82cxxx_dev *vdev = pci_get_drvdata(hwif->pci_dev); | ||
446 | |||
447 | if (via_cable_override()) | ||
448 | return ATA_CBL_PATA40_SHORT; | ||
449 | |||
450 | if ((vdev->via_80w >> hwif->channel) & 1) | ||
451 | return ATA_CBL_PATA80; | ||
452 | else | ||
453 | return ATA_CBL_PATA40; | ||
454 | } | ||
455 | |||
418 | static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif) | 456 | static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif) |
419 | { | 457 | { |
420 | struct via82cxxx_dev *vdev = pci_get_drvdata(hwif->pci_dev); | 458 | struct via82cxxx_dev *vdev = pci_get_drvdata(hwif->pci_dev); |
@@ -448,12 +486,8 @@ static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif) | |||
448 | hwif->mwdma_mask = 0x07; | 486 | hwif->mwdma_mask = 0x07; |
449 | hwif->swdma_mask = 0x07; | 487 | hwif->swdma_mask = 0x07; |
450 | 488 | ||
451 | if (hwif->cbl != ATA_CBL_PATA40_SHORT) { | 489 | if (hwif->cbl != ATA_CBL_PATA40_SHORT) |
452 | if ((vdev->via_80w >> hwif->channel) & 1) | 490 | hwif->cbl = via82cxxx_cable_detect(hwif); |
453 | hwif->cbl = ATA_CBL_PATA80; | ||
454 | else | ||
455 | hwif->cbl = ATA_CBL_PATA40; | ||
456 | } | ||
457 | 491 | ||
458 | hwif->ide_dma_check = &via82cxxx_ide_dma_check; | 492 | hwif->ide_dma_check = &via82cxxx_ide_dma_check; |
459 | if (!noautodma) | 493 | if (!noautodma) |