summaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_via.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-12-03 20:32:13 +0100
committerJeff Garzik <jgarzik@redhat.com>2009-12-03 16:13:39 -0500
commitc4d8a20022e617174eb887c82356d3f513e279a7 (patch)
treeadf51416fffec4e097fea4743bd94853f30f4079 /drivers/ata/pata_via.c
parent750c7136ea873255ed0b74e20f0d3ef9ac8984c0 (diff)
downloadblackbird-op-linux-c4d8a20022e617174eb887c82356d3f513e279a7.tar.gz
blackbird-op-linux-c4d8a20022e617174eb887c82356d3f513e279a7.zip
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>
Diffstat (limited to 'drivers/ata/pata_via.c')
-rw-r--r--drivers/ata/pata_via.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c
index 78eac276effb..0d97890af681 100644
--- a/drivers/ata/pata_via.c
+++ b/drivers/ata/pata_via.c
@@ -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);
}
}
OpenPOWER on IntegriCloud