mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-15 00:34:10 +08:00
trm290: use custom ->dma_{start,end} to handle trm290_prepare_drive()
Use custom ->dma_{start,end} methods to handle trm290_prepare_drive() there instead of in ->dma_setup method. There should be no functional changes caused by this patch (DMA support is disabled currently in trm290.c). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This commit is contained in:
parent
a6d67ffa7d
commit
7526efaafd
@ -184,7 +184,6 @@ static int trm290_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
|
|||||||
if (cmd->tf_flags & IDE_TFLAG_WRITE) {
|
if (cmd->tf_flags & IDE_TFLAG_WRITE) {
|
||||||
#ifdef TRM290_NO_DMA_WRITES
|
#ifdef TRM290_NO_DMA_WRITES
|
||||||
/* always use PIO for writes */
|
/* always use PIO for writes */
|
||||||
trm290_prepare_drive(drive, 0); /* select PIO xfer */
|
|
||||||
return 1;
|
return 1;
|
||||||
#endif
|
#endif
|
||||||
rw = 1;
|
rw = 1;
|
||||||
@ -195,11 +194,8 @@ static int trm290_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
|
|||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
ide_map_sg(drive, cmd);
|
ide_map_sg(drive, cmd);
|
||||||
/* try PIO instead of DMA */
|
/* try PIO instead of DMA */
|
||||||
trm290_prepare_drive(drive, 0); /* select PIO xfer */
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
/* select DMA xfer */
|
|
||||||
trm290_prepare_drive(drive, 1);
|
|
||||||
outl(hwif->dmatable_dma | rw, hwif->dma_base);
|
outl(hwif->dmatable_dma | rw, hwif->dma_base);
|
||||||
drive->waiting_for_dma = 1;
|
drive->waiting_for_dma = 1;
|
||||||
/* start DMA */
|
/* start DMA */
|
||||||
@ -209,6 +205,7 @@ static int trm290_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
|
|||||||
|
|
||||||
static void trm290_dma_start(ide_drive_t *drive)
|
static void trm290_dma_start(ide_drive_t *drive)
|
||||||
{
|
{
|
||||||
|
trm290_prepare_drive(drive, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int trm290_dma_end(ide_drive_t *drive)
|
static int trm290_dma_end(ide_drive_t *drive)
|
||||||
@ -219,6 +216,8 @@ static int trm290_dma_end(ide_drive_t *drive)
|
|||||||
|
|
||||||
status = inw(drive->hwif->dma_base + 2);
|
status = inw(drive->hwif->dma_base + 2);
|
||||||
|
|
||||||
|
trm290_prepare_drive(drive, 0);
|
||||||
|
|
||||||
return status != 0x00ff;
|
return status != 0x00ff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user