aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/amd74xx.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-03-04 11:24:06 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-04 11:24:06 -0500
commit4c10c937cc2eb197db565392db91d429eec71176 (patch)
tree02d7f15b314441e832f48f0f882882042361396c /drivers/ide/amd74xx.c
parent9bb676966aa85e56af00b353387d3c274a26e480 (diff)
parent950f564b707ca1b1c5bb94cd1e7d2a0702bfcadc (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-next-2.6: (49 commits) drivers/ide: Fix continuation line formats ide: fixed section mismatch warning in cmd640.c ide: ide_timing_compute() fixup ide: make ide_get_best_pio_mode() static via82cxxx: use ->pio_mode value to determine pair device speed tx493xide: use ->pio_mode value to determine pair device speed siimage: use ->pio_mode value to determine pair device speed palm_bk3710: use ->pio_mode value to determine pair device speed it821x: use ->pio_mode value to determine pair device speed cs5536: use ->pio_mode value to determine pair device speed cs5535: use ->pio_mode value to determine pair device speed cmd64x: fix handling of address setup timings amd74xx: use ->pio_mode value to determine pair device speed alim15x3: fix handling of UDMA enable bit alim15x3: fix handling of DMA timings alim15x3: fix handling of command timings alim15x3: fix handling of address setup timings ide-timings: use ->pio_mode value to determine fastest PIO speed ide: change ->set_dma_mode method parameters ide: change ->set_pio_mode method parameters ...
Diffstat (limited to 'drivers/ide/amd74xx.c')
-rw-r--r--drivers/ide/amd74xx.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/ide/amd74xx.c b/drivers/ide/amd74xx.c
index 628cd2e5fed8..3747b2561f09 100644
--- a/drivers/ide/amd74xx.c
+++ b/drivers/ide/amd74xx.c
@@ -3,7 +3,7 @@
3 * IDE driver for Linux. 3 * IDE driver for Linux.
4 * 4 *
5 * Copyright (c) 2000-2002 Vojtech Pavlik 5 * Copyright (c) 2000-2002 Vojtech Pavlik
6 * Copyright (c) 2007-2008 Bartlomiej Zolnierkiewicz 6 * Copyright (c) 2007-2010 Bartlomiej Zolnierkiewicz
7 * 7 *
8 * Based on the work of: 8 * Based on the work of:
9 * Andre Hedrick 9 * Andre Hedrick
@@ -70,7 +70,8 @@ static void amd_set_speed(struct pci_dev *dev, u8 dn, u8 udma_mask,
70 default: return; 70 default: return;
71 } 71 }
72 72
73 pci_write_config_byte(dev, AMD_UDMA_TIMING + offset + (3 - dn), t); 73 if (timing->udma)
74 pci_write_config_byte(dev, AMD_UDMA_TIMING + offset + 3 - dn, t);
74} 75}
75 76
76/* 77/*
@@ -78,14 +79,14 @@ static void amd_set_speed(struct pci_dev *dev, u8 dn, u8 udma_mask,
78 * to a desired transfer mode. It also can be called by upper layers. 79 * to a desired transfer mode. It also can be called by upper layers.
79 */ 80 */
80 81
81static void amd_set_drive(ide_drive_t *drive, const u8 speed) 82static void amd_set_drive(ide_hwif_t *hwif, ide_drive_t *drive)
82{ 83{
83 ide_hwif_t *hwif = drive->hwif;
84 struct pci_dev *dev = to_pci_dev(hwif->dev); 84 struct pci_dev *dev = to_pci_dev(hwif->dev);
85 ide_drive_t *peer = ide_get_pair_dev(drive); 85 ide_drive_t *peer = ide_get_pair_dev(drive);
86 struct ide_timing t, p; 86 struct ide_timing t, p;
87 int T, UT; 87 int T, UT;
88 u8 udma_mask = hwif->ultra_mask; 88 u8 udma_mask = hwif->ultra_mask;
89 const u8 speed = drive->dma_mode;
89 90
90 T = 1000000000 / amd_clock; 91 T = 1000000000 / amd_clock;
91 UT = (udma_mask == ATA_UDMA2) ? T : (T / 2); 92 UT = (udma_mask == ATA_UDMA2) ? T : (T / 2);
@@ -93,7 +94,7 @@ static void amd_set_drive(ide_drive_t *drive, const u8 speed)
93 ide_timing_compute(drive, speed, &t, T, UT); 94 ide_timing_compute(drive, speed, &t, T, UT);
94 95
95 if (peer) { 96 if (peer) {
96 ide_timing_compute(peer, peer->current_speed, &p, T, UT); 97 ide_timing_compute(peer, peer->pio_mode, &p, T, UT);
97 ide_timing_merge(&p, &t, &t, IDE_TIMING_8BIT); 98 ide_timing_merge(&p, &t, &t, IDE_TIMING_8BIT);
98 } 99 }
99 100
@@ -107,9 +108,10 @@ static void amd_set_drive(ide_drive_t *drive, const u8 speed)
107 * amd_set_pio_mode() is a callback from upper layers for PIO-only tuning. 108 * amd_set_pio_mode() is a callback from upper layers for PIO-only tuning.
108 */ 109 */
109 110
110static void amd_set_pio_mode(ide_drive_t *drive, const u8 pio) 111static void amd_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
111{ 112{
112 amd_set_drive(drive, XFER_PIO_0 + pio); 113 drive->dma_mode = drive->pio_mode;
114 amd_set_drive(hwif, drive);
113} 115}
114 116
115static void amd7409_cable_detect(struct pci_dev *dev) 117static void amd7409_cable_detect(struct pci_dev *dev)
@@ -340,6 +342,6 @@ static void __exit amd74xx_ide_exit(void)
340module_init(amd74xx_ide_init); 342module_init(amd74xx_ide_init);
341module_exit(amd74xx_ide_exit); 343module_exit(amd74xx_ide_exit);
342 344
343MODULE_AUTHOR("Vojtech Pavlik"); 345MODULE_AUTHOR("Vojtech Pavlik, Bartlomiej Zolnierkiewicz");
344MODULE_DESCRIPTION("AMD PCI IDE driver"); 346MODULE_DESCRIPTION("AMD PCI IDE driver");
345MODULE_LICENSE("GPL"); 347MODULE_LICENSE("GPL");