diff options
Diffstat (limited to 'drivers/ide/pci/atiixp.c')
-rw-r--r-- | drivers/ide/pci/atiixp.c | 40 |
1 files changed, 2 insertions, 38 deletions
diff --git a/drivers/ide/pci/atiixp.c b/drivers/ide/pci/atiixp.c index 2d48af32e3f4..0e52ad722a72 100644 --- a/drivers/ide/pci/atiixp.c +++ b/drivers/ide/pci/atiixp.c | |||
@@ -49,22 +49,6 @@ static int save_mdma_mode[4]; | |||
49 | static DEFINE_SPINLOCK(atiixp_lock); | 49 | static DEFINE_SPINLOCK(atiixp_lock); |
50 | 50 | ||
51 | /** | 51 | /** |
52 | * atiixp_ratemask - compute rate mask for ATIIXP IDE | ||
53 | * @drive: IDE drive to compute for | ||
54 | * | ||
55 | * Returns the available modes for the ATIIXP IDE controller. | ||
56 | */ | ||
57 | |||
58 | static u8 atiixp_ratemask(ide_drive_t *drive) | ||
59 | { | ||
60 | u8 mode = 3; | ||
61 | |||
62 | if (!eighty_ninty_three(drive)) | ||
63 | mode = min(mode, (u8)1); | ||
64 | return mode; | ||
65 | } | ||
66 | |||
67 | /** | ||
68 | * atiixp_dma_2_pio - return the PIO mode matching DMA | 52 | * atiixp_dma_2_pio - return the PIO mode matching DMA |
69 | * @xfer_rate: transfer speed | 53 | * @xfer_rate: transfer speed |
70 | * | 54 | * |
@@ -189,7 +173,7 @@ static int atiixp_speedproc(ide_drive_t *drive, u8 xferspeed) | |||
189 | u16 tmp16; | 173 | u16 tmp16; |
190 | u8 speed, pio; | 174 | u8 speed, pio; |
191 | 175 | ||
192 | speed = ide_rate_filter(atiixp_ratemask(drive), xferspeed); | 176 | speed = ide_rate_filter(drive, xferspeed); |
193 | 177 | ||
194 | spin_lock_irqsave(&atiixp_lock, flags); | 178 | spin_lock_irqsave(&atiixp_lock, flags); |
195 | 179 | ||
@@ -223,26 +207,6 @@ static int atiixp_speedproc(ide_drive_t *drive, u8 xferspeed) | |||
223 | } | 207 | } |
224 | 208 | ||
225 | /** | 209 | /** |
226 | * atiixp_config_drive_for_dma - configure drive for DMA | ||
227 | * @drive: IDE drive to configure | ||
228 | * | ||
229 | * Set up a ATIIXP interface channel for the best available speed. | ||
230 | * We prefer UDMA if it is available and then MWDMA. If DMA is | ||
231 | * not available we switch to PIO and return 0. | ||
232 | */ | ||
233 | |||
234 | static int atiixp_config_drive_for_dma(ide_drive_t *drive) | ||
235 | { | ||
236 | u8 speed = ide_dma_speed(drive, atiixp_ratemask(drive)); | ||
237 | |||
238 | if (!speed) | ||
239 | return 0; | ||
240 | |||
241 | (void) atiixp_speedproc(drive, speed); | ||
242 | return ide_dma_enable(drive); | ||
243 | } | ||
244 | |||
245 | /** | ||
246 | * atiixp_dma_check - set up an IDE device | 210 | * atiixp_dma_check - set up an IDE device |
247 | * @drive: IDE drive to configure | 211 | * @drive: IDE drive to configure |
248 | * | 212 | * |
@@ -256,7 +220,7 @@ static int atiixp_dma_check(ide_drive_t *drive) | |||
256 | 220 | ||
257 | drive->init_speed = 0; | 221 | drive->init_speed = 0; |
258 | 222 | ||
259 | if (ide_use_dma(drive) && atiixp_config_drive_for_dma(drive)) | 223 | if (ide_tune_dma(drive)) |
260 | return 0; | 224 | return 0; |
261 | 225 | ||
262 | if (ide_use_fast_pio(drive)) { | 226 | if (ide_use_fast_pio(drive)) { |