aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-05-15 18:51:43 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-05-15 18:51:43 -0400
commitbd203b57c7edd6bc457b769cd15fa7239cd2241e (patch)
tree9c62fee37780fa38bbd47bbbec00571159ec9093 /drivers
parent5fd216bbb277b645109a889c489e13a7aafbc304 (diff)
ide: use ide_tune_dma() part #2
Use ide_tune_dma() in ide-cris/it821x/pdc202xx_old/serverworks drivers. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/cris/ide-cris.c14
-rw-r--r--drivers/ide/pci/it821x.c21
-rw-r--r--drivers/ide/pci/pdc202xx_old.c14
-rw-r--r--drivers/ide/pci/serverworks.c13
4 files changed, 4 insertions, 58 deletions
diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c
index c04cb25a01ff..ca0341c05e55 100644
--- a/drivers/ide/cris/ide-cris.c
+++ b/drivers/ide/cris/ide-cris.c
@@ -1002,18 +1002,6 @@ static int cris_ide_build_dmatable (ide_drive_t *drive)
1002 return 1; /* let the PIO routines handle this weirdness */ 1002 return 1; /* let the PIO routines handle this weirdness */
1003} 1003}
1004 1004
1005static int cris_config_drive_for_dma (ide_drive_t *drive)
1006{
1007 u8 speed = ide_max_dma_mode(drive);
1008
1009 if (!speed)
1010 return 0;
1011
1012 speed_cris_ide(drive, speed);
1013
1014 return ide_dma_enable(drive);
1015}
1016
1017/* 1005/*
1018 * cris_dma_intr() is the handler for disk read/write DMA interrupts 1006 * cris_dma_intr() is the handler for disk read/write DMA interrupts
1019 */ 1007 */
@@ -1043,7 +1031,7 @@ static ide_startstop_t cris_dma_intr (ide_drive_t *drive)
1043 1031
1044static int cris_dma_check(ide_drive_t *drive) 1032static int cris_dma_check(ide_drive_t *drive)
1045{ 1033{
1046 if (ide_use_dma(drive) && cris_config_drive_for_dma(drive)) 1034 if (ide_tune_dma(drive))
1047 return 0; 1035 return 0;
1048 1036
1049 return -1; 1037 return -1;
diff --git a/drivers/ide/pci/it821x.c b/drivers/ide/pci/it821x.c
index 442f658c6ae7..5faaff87d580 100644
--- a/drivers/ide/pci/it821x.c
+++ b/drivers/ide/pci/it821x.c
@@ -464,25 +464,6 @@ static int it821x_tune_chipset (ide_drive_t *drive, byte xferspeed)
464} 464}
465 465
466/** 466/**
467 * config_chipset_for_dma - configure for DMA
468 * @drive: drive to configure
469 *
470 * Called by the IDE layer when it wants the timings set up.
471 */
472
473static int config_chipset_for_dma (ide_drive_t *drive)
474{
475 u8 speed = ide_max_dma_mode(drive);
476
477 if (speed == 0)
478 return 0;
479
480 it821x_tune_chipset(drive, speed);
481
482 return ide_dma_enable(drive);
483}
484
485/**
486 * it821x_configure_drive_for_dma - set up for DMA transfers 467 * it821x_configure_drive_for_dma - set up for DMA transfers
487 * @drive: drive we are going to set up 468 * @drive: drive we are going to set up
488 * 469 *
@@ -494,7 +475,7 @@ static int config_chipset_for_dma (ide_drive_t *drive)
494 475
495static int it821x_config_drive_for_dma (ide_drive_t *drive) 476static int it821x_config_drive_for_dma (ide_drive_t *drive)
496{ 477{
497 if (ide_use_dma(drive) && config_chipset_for_dma(drive)) 478 if (ide_tune_dma(drive))
498 return 0; 479 return 0;
499 480
500 it821x_tuneproc(drive, 255); 481 it821x_tuneproc(drive, 255);
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index a6dd9c815342..23844687deea 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -181,23 +181,11 @@ static void pdc_old_disable_66MHz_clock(ide_hwif_t *hwif)
181 outb(clock & ~(hwif->channel ? 0x08 : 0x02), clock_reg); 181 outb(clock & ~(hwif->channel ? 0x08 : 0x02), clock_reg);
182} 182}
183 183
184static int config_chipset_for_dma (ide_drive_t *drive)
185{
186 u8 speed = ide_max_dma_mode(drive);
187
188 if (!speed)
189 return 0;
190
191 (void)pdc202xx_tune_chipset(drive, speed);
192
193 return ide_dma_enable(drive);
194}
195
196static int pdc202xx_config_drive_xfer_rate (ide_drive_t *drive) 184static int pdc202xx_config_drive_xfer_rate (ide_drive_t *drive)
197{ 185{
198 drive->init_speed = 0; 186 drive->init_speed = 0;
199 187
200 if (ide_use_dma(drive) && config_chipset_for_dma(drive)) 188 if (ide_tune_dma(drive))
201 return 0; 189 return 0;
202 190
203 if (ide_use_fast_pio(drive)) 191 if (ide_use_fast_pio(drive))
diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c
index a94e77d67db3..6234f806c6b5 100644
--- a/drivers/ide/pci/serverworks.c
+++ b/drivers/ide/pci/serverworks.c
@@ -270,22 +270,11 @@ static void svwks_tune_drive (ide_drive_t *drive, u8 pio)
270 (void)svwks_tune_chipset(drive, XFER_PIO_0 + pio); 270 (void)svwks_tune_chipset(drive, XFER_PIO_0 + pio);
271} 271}
272 272
273static int config_chipset_for_dma (ide_drive_t *drive)
274{
275 u8 speed = ide_max_dma_mode(drive);
276
277 if (!speed)
278 return 0;
279
280 (void) svwks_tune_chipset(drive, speed);
281 return ide_dma_enable(drive);
282}
283
284static int svwks_config_drive_xfer_rate (ide_drive_t *drive) 273static int svwks_config_drive_xfer_rate (ide_drive_t *drive)
285{ 274{
286 drive->init_speed = 0; 275 drive->init_speed = 0;
287 276
288 if (ide_use_dma(drive) && config_chipset_for_dma(drive)) 277 if (ide_tune_dma(drive))
289 return 0; 278 return 0;
290 279
291 if (ide_use_fast_pio(drive)) 280 if (ide_use_fast_pio(drive))