From 8704de8f296fcf6a4b2ff6bfd9a63974ad909b3e Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 26 Jan 2008 20:13:00 +0100 Subject: 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 --- drivers/ide/ide-dma.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'drivers/ide/ide-dma.c') 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); static int ide_tune_dma(ide_drive_t *drive) { + ide_hwif_t *hwif = drive->hwif; u8 speed; if (noautodma || drive->nodma || (drive->id->capability & 1) == 0) @@ -767,15 +768,21 @@ static int ide_tune_dma(ide_drive_t *drive) if (ide_id_dma_bug(drive)) return 0; - if (drive->hwif->host_flags & IDE_HFLAG_TRUST_BIOS_FOR_DMA) + if (hwif->host_flags & IDE_HFLAG_TRUST_BIOS_FOR_DMA) return config_drive_for_dma(drive); speed = ide_max_dma_mode(drive); - if (!speed) - return 0; + if (!speed) { + /* is this really correct/needed? */ + if ((hwif->host_flags & IDE_HFLAG_CY82C693) && + ide_dma_good_drive(drive)) + return 1; + else + return 0; + } - if (drive->hwif->host_flags & IDE_HFLAG_NO_SET_MODE) + if (hwif->host_flags & IDE_HFLAG_NO_SET_MODE) return 0; if (ide_set_dma_mode(drive, speed)) -- cgit v1.2.3-55-g7522