diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-25 16:17:18 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-25 16:17:18 -0500 |
commit | 4db90a145292327b95b03f6dcd3352327235cc36 (patch) | |
tree | c48ba5fc31e27d6fbdb8883151bdf237e7eb1920 /drivers/ide/ppc/pmac.c | |
parent | 428c6440ef933a3d9df5adfeb2cbb3ea7ebb6a68 (diff) |
ide: add IDE_HFLAG_ABUSE_SET_DMA_MODE host flag
* Add IDE_HFLAG_ABUSE_SET_DMA_MODE host flag and use it to decide
what to do with transfer modes < XFER_PIO_0 in ide_set_xfer_rate().
* Set IDE_HFLAG_ABUSE_SET_DMA_MODE in host drivers that need it
(aec62xx, amd74xx, cs5520, cs5535, hpt34x, hpt366, pdc202xx_old,
serverworks, tc86c001 and via82cxxx) and cleanup ->set_dma_mode
methods in host drivers that don't (IDE core code guarantees that
->set_dma_mode will be called only for modes which are present
in SWDMA/MWDMA/UDMA masks).
While at it:
* Add IDE_HFLAGS_HPT34X/HPT3XX/PDC202XX/SVWKS define in
hpt34x/hpt366/pdc202xx_old/serverworks host driver.
There should be no functionality changes caused by this patch.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ppc/pmac.c')
-rw-r--r-- | drivers/ide/ppc/pmac.c | 42 |
1 files changed, 12 insertions, 30 deletions
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index 4559e29446e9..3dce80092fff 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c | |||
@@ -828,38 +828,20 @@ static void pmac_ide_set_dma_mode(ide_drive_t *drive, const u8 speed) | |||
828 | tl[0] = *timings; | 828 | tl[0] = *timings; |
829 | tl[1] = *timings2; | 829 | tl[1] = *timings2; |
830 | 830 | ||
831 | switch(speed) { | ||
832 | #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC | 831 | #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC |
833 | case XFER_UDMA_6: | 832 | if (speed >= XFER_UDMA_0) { |
834 | case XFER_UDMA_5: | 833 | if (pmif->kind == controller_kl_ata4) |
835 | case XFER_UDMA_4: | 834 | ret = set_timings_udma_ata4(&tl[0], speed); |
836 | case XFER_UDMA_3: | 835 | else if (pmif->kind == controller_un_ata6 |
837 | case XFER_UDMA_2: | 836 | || pmif->kind == controller_k2_ata6) |
838 | case XFER_UDMA_1: | 837 | ret = set_timings_udma_ata6(&tl[0], &tl[1], speed); |
839 | case XFER_UDMA_0: | 838 | else if (pmif->kind == controller_sh_ata6) |
840 | if (pmif->kind == controller_kl_ata4) | 839 | ret = set_timings_udma_shasta(&tl[0], &tl[1], speed); |
841 | ret = set_timings_udma_ata4(&tl[0], speed); | 840 | else |
842 | else if (pmif->kind == controller_un_ata6 | 841 | ret = -1; |
843 | || pmif->kind == controller_k2_ata6) | 842 | } else |
844 | ret = set_timings_udma_ata6(&tl[0], &tl[1], speed); | 843 | set_timings_mdma(drive, pmif->kind, &tl[0], &tl[1], speed); |
845 | else if (pmif->kind == controller_sh_ata6) | ||
846 | ret = set_timings_udma_shasta(&tl[0], &tl[1], speed); | ||
847 | else | ||
848 | ret = 1; | ||
849 | break; | ||
850 | case XFER_MW_DMA_2: | ||
851 | case XFER_MW_DMA_1: | ||
852 | case XFER_MW_DMA_0: | ||
853 | set_timings_mdma(drive, pmif->kind, &tl[0], &tl[1], speed); | ||
854 | break; | ||
855 | case XFER_SW_DMA_2: | ||
856 | case XFER_SW_DMA_1: | ||
857 | case XFER_SW_DMA_0: | ||
858 | return; | ||
859 | #endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ | 844 | #endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ |
860 | default: | ||
861 | ret = 1; | ||
862 | } | ||
863 | if (ret) | 845 | if (ret) |
864 | return; | 846 | return; |
865 | 847 | ||