Lines 243-249
static void via_do_set_mode(struct ata_port *ap, struct ata_device *adev, int mo
Link Here
|
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 |
|
Lines 290-298
static void via_do_set_mode(struct ata_port *ap, struct ata_device *adev, int mo
Link Here
|
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 |
|
298 |
static void via_set_piomode(struct ata_port *ap, struct ata_device *adev) |
305 |
static void via_set_piomode(struct ata_port *ap, struct ata_device *adev) |