aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2010-01-18 02:19:53 -0500
committerDavid S. Miller <davem@davemloft.net>2010-01-19 04:41:58 -0500
commita13e4865fac374f2edf2666b66f2f88e527db2b7 (patch)
treef5a3e6be7ce5156ce7d19cfa079c2192ba8cf04a
parent76937fa765bd65c052b87812e46d5b90094e57b8 (diff)
via82cxxx: fix SATA cable detection
Add VIA_SATA_PATA flag for cx700, vx800 and vx855 chipsets (the first port is SATA). Based on commits 7585eb1, bfce5e0 and e4d866c for pata_via host driver. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/ide/via82cxxx.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/ide/via82cxxx.c b/drivers/ide/via82cxxx.c
index 29f3be311f8d..11b3e711451a 100644
--- a/drivers/ide/via82cxxx.c
+++ b/drivers/ide/via82cxxx.c
@@ -54,6 +54,7 @@
54#define VIA_NO_UNMASK 0x08 /* Doesn't work with IRQ unmasking on */ 54#define VIA_NO_UNMASK 0x08 /* Doesn't work with IRQ unmasking on */
55#define VIA_BAD_ID 0x10 /* Has wrong vendor ID (0x1107) */ 55#define VIA_BAD_ID 0x10 /* Has wrong vendor ID (0x1107) */
56#define VIA_BAD_AST 0x20 /* Don't touch Address Setup Timing */ 56#define VIA_BAD_AST 0x20 /* Don't touch Address Setup Timing */
57#define VIA_SATA_PATA 0x80 /* SATA/PATA combined configuration */
57 58
58enum { 59enum {
59 VIA_IDFLAG_SINGLE = (1 << 1), /* single channel controller */ 60 VIA_IDFLAG_SINGLE = (1 << 1), /* single channel controller */
@@ -71,9 +72,9 @@ static struct via_isa_bridge {
71 u8 udma_mask; 72 u8 udma_mask;
72 u8 flags; 73 u8 flags;
73} via_isa_bridges[] = { 74} via_isa_bridges[] = {
74 { "vx855", PCI_DEVICE_ID_VIA_VX855, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST }, 75 { "vx855", PCI_DEVICE_ID_VIA_VX855, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST | VIA_SATA_PATA },
75 { "vx800", PCI_DEVICE_ID_VIA_VX800, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST }, 76 { "vx800", PCI_DEVICE_ID_VIA_VX800, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST | VIA_SATA_PATA },
76 { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST }, 77 { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST | VIA_SATA_PATA },
77 { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST }, 78 { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
78 { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST }, 79 { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
79 { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST }, 80 { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
@@ -366,6 +367,9 @@ static u8 via82cxxx_cable_detect(ide_hwif_t *hwif)
366 if (via_cable_override(pdev)) 367 if (via_cable_override(pdev))
367 return ATA_CBL_PATA40_SHORT; 368 return ATA_CBL_PATA40_SHORT;
368 369
370 if ((vdev->via_config->flags & VIA_SATA_PATA) && hwif->channel == 0)
371 return ATA_CBL_SATA;
372
369 if ((vdev->via_80w >> hwif->channel) & 1) 373 if ((vdev->via_80w >> hwif->channel) & 1)
370 return ATA_CBL_PATA80; 374 return ATA_CBL_PATA80;
371 else 375 else