aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/pata_via.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c
index ea18e33f50ef..1b0acafad1a6 100644
--- a/drivers/ata/pata_via.c
+++ b/drivers/ata/pata_via.c
@@ -243,7 +243,6 @@ static void via_do_set_mode(struct ata_port *ap, struct ata_device *adev, int mo
243 int ut; 243 int ut;
244 int offset = 3 - (2*ap->port_no) - adev->devno; 244 int offset = 3 - (2*ap->port_no) - adev->devno;
245 245
246
247 /* Calculate the timing values we require */ 246 /* Calculate the timing values we require */
248 ata_timing_compute(adev, mode, &t, T, UT); 247 ata_timing_compute(adev, mode, &t, T, UT);
249 248
@@ -290,9 +289,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; 289 ut = t.udma ? (0xe0 | (FIT(t.udma, 2, 9) - 2)) : 0x07;
291 break; 290 break;
292 } 291 }
292
293 /* Set UDMA unless device is not UDMA capable */ 293 /* Set UDMA unless device is not UDMA capable */
294 if (udma_type) 294 if (udma_type) {
295 pci_write_config_byte(pdev, 0x50 + offset, ut); 295 u8 cable80_status;
296
297 /* Get 80-wire cable detection bit */
298 pci_read_config_byte(pdev, 0x50 + offset, &cable80_status);
299 cable80_status &= 0x10;
300
301 pci_write_config_byte(pdev, 0x50 + offset, ut | cable80_status);
302 }
296} 303}
297 304
298static void via_set_piomode(struct ata_port *ap, struct ata_device *adev) 305static void via_set_piomode(struct ata_port *ap, struct ata_device *adev)