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/hpt366.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/hpt366.c')
-rw-r--r-- | drivers/ide/pci/hpt366.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c index de5ad9c35dc6..fcbc5605b38e 100644 --- a/drivers/ide/pci/hpt366.c +++ b/drivers/ide/pci/hpt366.c | |||
@@ -669,24 +669,6 @@ static void hpt3xx_tune_drive(ide_drive_t *drive, u8 pio) | |||
669 | (void) hpt3xx_tune_chipset (drive, XFER_PIO_0 + pio); | 669 | (void) hpt3xx_tune_chipset (drive, XFER_PIO_0 + pio); |
670 | } | 670 | } |
671 | 671 | ||
672 | /* | ||
673 | * This allows the configuration of ide_pci chipset registers | ||
674 | * for cards that learn about the drive's UDMA, DMA, PIO capabilities | ||
675 | * after the drive is reported by the OS. Initially designed for | ||
676 | * HPT366 UDMA chipset by HighPoint|Triones Technologies, Inc. | ||
677 | * | ||
678 | */ | ||
679 | static int config_chipset_for_dma(ide_drive_t *drive) | ||
680 | { | ||
681 | u8 speed = ide_max_dma_mode(drive); | ||
682 | |||
683 | if (!speed) | ||
684 | return 0; | ||
685 | |||
686 | (void) hpt3xx_tune_chipset(drive, speed); | ||
687 | return ide_dma_enable(drive); | ||
688 | } | ||
689 | |||
690 | static int hpt3xx_quirkproc(ide_drive_t *drive) | 672 | static int hpt3xx_quirkproc(ide_drive_t *drive) |
691 | { | 673 | { |
692 | struct hd_driveid *id = drive->id; | 674 | struct hd_driveid *id = drive->id; |
@@ -741,7 +723,7 @@ static int hpt366_config_drive_xfer_rate(ide_drive_t *drive) | |||
741 | { | 723 | { |
742 | drive->init_speed = 0; | 724 | drive->init_speed = 0; |
743 | 725 | ||
744 | if (ide_use_dma(drive) && config_chipset_for_dma(drive)) | 726 | if (ide_tune_dma(drive)) |
745 | return 0; | 727 | return 0; |
746 | 728 | ||
747 | if (ide_use_fast_pio(drive)) | 729 | if (ide_use_fast_pio(drive)) |