aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_via.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_via.c')
-rw-r--r--drivers/ata/pata_via.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c
index ea18e33f50ef..636c4f1a0b24 100644
--- a/drivers/ata/pata_via.c
+++ b/drivers/ata/pata_via.c
@@ -97,6 +97,7 @@ static const struct via_isa_bridge {
97 u8 rev_max; 97 u8 rev_max;
98 u16 flags; 98 u16 flags;
99} via_isa_bridges[] = { 99} via_isa_bridges[] = {
100 { "vx800", PCI_DEVICE_ID_VIA_VX800, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
100 { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, 101 { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
101 { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, 102 { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
102 { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, 103 { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
@@ -243,7 +244,6 @@ static void via_do_set_mode(struct ata_port *ap, struct ata_device *adev, int mo
243 int ut; 244 int ut;
244 int offset = 3 - (2*ap->port_no) - adev->devno; 245 int offset = 3 - (2*ap->port_no) - adev->devno;
245 246
246
247 /* Calculate the timing values we require */ 247 /* Calculate the timing values we require */
248 ata_timing_compute(adev, mode, &t, T, UT); 248 ata_timing_compute(adev, mode, &t, T, UT);
249 249
@@ -290,9 +290,17 @@ static void via_do_set_mode(struct ata_port *ap, struct ata_device *adev, int mo
290 ut = t.udma ? (0xe0 | (FIT(t.udma, 2, 9) - 2)) : 0x07; 290 ut = t.udma ? (0xe0 | (FIT(t.udma, 2, 9) - 2)) : 0x07;
291 break; 291 break;
292 } 292 }
293
293 /* Set UDMA unless device is not UDMA capable */ 294 /* Set UDMA unless device is not UDMA capable */
294 if (udma_type) 295 if (udma_type) {
295 pci_write_config_byte(pdev, 0x50 + offset, ut); 296 u8 cable80_status;
297
298 /* Get 80-wire cable detection bit */
299 pci_read_config_byte(pdev, 0x50 + offset, &cable80_status);
300 cable80_status &= 0x10;
301
302 pci_write_config_byte(pdev, 0x50 + offset, ut | cable80_status);
303 }
296} 304}
297 305
298static void via_set_piomode(struct ata_port *ap, struct ata_device *adev) 306static void via_set_piomode(struct ata_port *ap, struct ata_device *adev)