aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/jmicron.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/pci/jmicron.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/pci/jmicron.c')
-rw-r--r--drivers/ide/pci/jmicron.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/drivers/ide/pci/jmicron.c b/drivers/ide/pci/jmicron.c
index dbb3c199cba9..76ed25147229 100644
--- a/drivers/ide/pci/jmicron.c
+++ b/drivers/ide/pci/jmicron.c
@@ -119,25 +119,6 @@ static int jmicron_tune_chipset (ide_drive_t *drive, byte xferspeed)
119} 119}
120 120
121/** 121/**
122 * config_chipset_for_dma - configure for DMA
123 * @drive: drive to configure
124 *
125 * As the JMicron snoops for timings all we actually need to do is
126 * make sure we don't set an invalid mode.
127 */
128
129static int config_chipset_for_dma (ide_drive_t *drive)
130{
131 u8 speed = ide_max_dma_mode(drive);
132
133 if (!speed)
134 return 0;
135
136 jmicron_tune_chipset(drive, speed);
137 return ide_dma_enable(drive);
138}
139
140/**
141 * jmicron_configure_drive_for_dma - set up for DMA transfers 122 * jmicron_configure_drive_for_dma - set up for DMA transfers
142 * @drive: drive we are going to set up 123 * @drive: drive we are going to set up
143 * 124 *
@@ -147,7 +128,7 @@ static int config_chipset_for_dma (ide_drive_t *drive)
147 128
148static int jmicron_config_drive_for_dma (ide_drive_t *drive) 129static int jmicron_config_drive_for_dma (ide_drive_t *drive)
149{ 130{
150 if (ide_use_dma(drive) && config_chipset_for_dma(drive)) 131 if (ide_tune_dma(drive))
151 return 0; 132 return 0;
152 133
153 config_jmicron_chipset_for_pio(drive, 1); 134 config_jmicron_chipset_for_pio(drive, 1);