diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-05-09 18:01:09 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-05-09 18:01:09 -0400 |
commit | 29e744d088e3555f4efbdf390f01088dd66993b6 (patch) | |
tree | 2747692efcef505872d29e0b62cb2345b0d64978 /drivers/ide/pci/it8213.c | |
parent | 2d5eaa6dd744a641e75503232a01f52d0768884c (diff) |
ide: add ide_tune_dma() helper
After reworking the code responsible for selecting the best DMA
transfer mode it is now possible to add generic ide_tune_dma() helper.
Convert some IDE PCI host drivers to use it (the ones left need more work).
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/it8213.c')
-rw-r--r-- | drivers/ide/pci/it8213.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/drivers/ide/pci/it8213.c b/drivers/ide/pci/it8213.c index 02b56cb7bb1b..c04a02687b95 100644 --- a/drivers/ide/pci/it8213.c +++ b/drivers/ide/pci/it8213.c | |||
@@ -197,25 +197,6 @@ static int it8213_tune_chipset (ide_drive_t *drive, u8 xferspeed) | |||
197 | return ide_config_drive_speed(drive, speed); | 197 | return ide_config_drive_speed(drive, speed); |
198 | } | 198 | } |
199 | 199 | ||
200 | /* | ||
201 | * config_chipset_for_dma - configure for DMA | ||
202 | * @drive: drive to configure | ||
203 | * | ||
204 | * Called by the IDE layer when it wants the timings set up. | ||
205 | */ | ||
206 | |||
207 | static int config_chipset_for_dma (ide_drive_t *drive) | ||
208 | { | ||
209 | u8 speed = ide_max_dma_mode(drive); | ||
210 | |||
211 | if (!speed) | ||
212 | return 0; | ||
213 | |||
214 | it8213_tune_chipset(drive, speed); | ||
215 | |||
216 | return ide_dma_enable(drive); | ||
217 | } | ||
218 | |||
219 | /** | 200 | /** |
220 | * it8213_configure_drive_for_dma - set up for DMA transfers | 201 | * it8213_configure_drive_for_dma - set up for DMA transfers |
221 | * @drive: drive we are going to set up | 202 | * @drive: drive we are going to set up |
@@ -230,7 +211,7 @@ static int it8213_config_drive_for_dma (ide_drive_t *drive) | |||
230 | { | 211 | { |
231 | u8 pio; | 212 | u8 pio; |
232 | 213 | ||
233 | if (ide_use_dma(drive) && config_chipset_for_dma(drive)) | 214 | if (ide_tune_dma(drive)) |
234 | return 0; | 215 | return 0; |
235 | 216 | ||
236 | pio = ide_get_best_pio_mode(drive, 255, 4, NULL); | 217 | pio = ide_get_best_pio_mode(drive, 255, 4, NULL); |