mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 03:06:10 +00:00
pata_via: clear UDMA transfer mode bit for PIO and MWDMA
Fix register naming while at it. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
This commit is contained in:
parent
750c7136ea
commit
c4d8a20022
1 changed files with 13 additions and 6 deletions
|
@ -303,14 +303,21 @@ static void via_do_set_mode(struct ata_port *ap, struct ata_device *adev, int mo
|
|||
}
|
||||
|
||||
/* Set UDMA unless device is not UDMA capable */
|
||||
if (udma_type && t.udma) {
|
||||
u8 cable80_status;
|
||||
if (udma_type) {
|
||||
u8 udma_etc;
|
||||
|
||||
/* Get 80-wire cable detection bit */
|
||||
pci_read_config_byte(pdev, 0x50 + offset, &cable80_status);
|
||||
cable80_status &= 0x10;
|
||||
pci_read_config_byte(pdev, 0x50 + offset, &udma_etc);
|
||||
|
||||
pci_write_config_byte(pdev, 0x50 + offset, ut | cable80_status);
|
||||
/* clear transfer mode bit */
|
||||
udma_etc &= ~0x20;
|
||||
|
||||
if (t.udma) {
|
||||
/* preserve 80-wire cable detection bit */
|
||||
udma_etc &= 0x10;
|
||||
udma_etc |= ut;
|
||||
}
|
||||
|
||||
pci_write_config_byte(pdev, 0x50 + offset, udma_etc);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue