aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-dma.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-05-09 18:01:09 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-05-09 18:01:09 -0400
commit29e744d088e3555f4efbdf390f01088dd66993b6 (patch)
tree2747692efcef505872d29e0b62cb2345b0d64978 /drivers/ide/ide-dma.c
parent2d5eaa6dd744a641e75503232a01f52d0768884c (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/ide-dma.c')
-rw-r--r--drivers/ide/ide-dma.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index f28fabb791fe..5fe85191d49c 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -779,6 +779,26 @@ u8 ide_max_dma_mode(ide_drive_t *drive)
779 779
780EXPORT_SYMBOL_GPL(ide_max_dma_mode); 780EXPORT_SYMBOL_GPL(ide_max_dma_mode);
781 781
782int ide_tune_dma(ide_drive_t *drive)
783{
784 u8 speed;
785
786 /* TODO: use only ide_max_dma_mode() */
787 if (!ide_use_dma(drive))
788 return 0;
789
790 speed = ide_max_dma_mode(drive);
791
792 if (!speed)
793 return 0;
794
795 drive->hwif->speedproc(drive, speed);
796
797 return ide_dma_enable(drive);
798}
799
800EXPORT_SYMBOL_GPL(ide_tune_dma);
801
782void ide_dma_verbose(ide_drive_t *drive) 802void ide_dma_verbose(ide_drive_t *drive)
783{ 803{
784 struct hd_driveid *id = drive->id; 804 struct hd_driveid *id = drive->id;