aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-dma.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-26 14:13:00 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-26 14:13:00 -0500
commit8704de8f296fcf6a4b2ff6bfd9a63974ad909b3e (patch)
tree386dccd98e7fc77b0c6b45b999bf474c04851165 /drivers/ide/ide-dma.c
parenta530201afed5074dac69b29c519a1df59da97945 (diff)
cy82c693: add ->set_dma_mode method
* Fix SWDMA/MWDMA masks in cy82c693_chipset. * Add IDE_HFLAG_CY82C693 host flag and use it in ide_tune_dma() to check whether the DMA should be enabled even if ide_max_dma_mode() fails. * Convert cy82c693_dma_enable() to become cy82c693_set_dma_mode() and remove no longer needed cy82c693_ide_dma_on(). Then set IDE_HFLAG_CY82C693 instead of IDE_HFLAG_TRUST_BIOS_FOR_DMA in cy82c693_chipset. * Bump driver version. As a result of this patch cy82c693 driver will configure and use DMA on all SWDMA0-2 and MWDMA0-2 capable ATA devices instead of relying on BIOS. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-dma.c')
-rw-r--r--drivers/ide/ide-dma.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 18c78ad2b31e..9d6dabbbf809 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -755,6 +755,7 @@ EXPORT_SYMBOL_GPL(ide_find_dma_mode);
755 755
756static int ide_tune_dma(ide_drive_t *drive) 756static int ide_tune_dma(ide_drive_t *drive)
757{ 757{
758 ide_hwif_t *hwif = drive->hwif;
758 u8 speed; 759 u8 speed;
759 760
760 if (noautodma || drive->nodma || (drive->id->capability & 1) == 0) 761 if (noautodma || drive->nodma || (drive->id->capability & 1) == 0)
@@ -767,15 +768,21 @@ static int ide_tune_dma(ide_drive_t *drive)
767 if (ide_id_dma_bug(drive)) 768 if (ide_id_dma_bug(drive))
768 return 0; 769 return 0;
769 770
770 if (drive->hwif->host_flags & IDE_HFLAG_TRUST_BIOS_FOR_DMA) 771 if (hwif->host_flags & IDE_HFLAG_TRUST_BIOS_FOR_DMA)
771 return config_drive_for_dma(drive); 772 return config_drive_for_dma(drive);
772 773
773 speed = ide_max_dma_mode(drive); 774 speed = ide_max_dma_mode(drive);
774 775
775 if (!speed) 776 if (!speed) {
776 return 0; 777 /* is this really correct/needed? */
778 if ((hwif->host_flags & IDE_HFLAG_CY82C693) &&
779 ide_dma_good_drive(drive))
780 return 1;
781 else
782 return 0;
783 }
777 784
778 if (drive->hwif->host_flags & IDE_HFLAG_NO_SET_MODE) 785 if (hwif->host_flags & IDE_HFLAG_NO_SET_MODE)
779 return 0; 786 return 0;
780 787
781 if (ide_set_dma_mode(drive, speed)) 788 if (ide_set_dma_mode(drive, speed))