diff options
Diffstat (limited to 'drivers/mmc/host/atmel-mci.c')
-rw-r--r-- | drivers/mmc/host/atmel-mci.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index a7ee50271465..fcfe1eb5acc8 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c | |||
@@ -823,6 +823,7 @@ atmci_prepare_data_dma(struct atmel_mci *host, struct mmc_data *data) | |||
823 | struct scatterlist *sg; | 823 | struct scatterlist *sg; |
824 | unsigned int i; | 824 | unsigned int i; |
825 | enum dma_data_direction direction; | 825 | enum dma_data_direction direction; |
826 | enum dma_transfer_direction slave_dirn; | ||
826 | unsigned int sglen; | 827 | unsigned int sglen; |
827 | u32 iflags; | 828 | u32 iflags; |
828 | 829 | ||
@@ -860,16 +861,19 @@ atmci_prepare_data_dma(struct atmel_mci *host, struct mmc_data *data) | |||
860 | if (host->caps.has_dma) | 861 | if (host->caps.has_dma) |
861 | atmci_writel(host, ATMCI_DMA, ATMCI_DMA_CHKSIZE(3) | ATMCI_DMAEN); | 862 | atmci_writel(host, ATMCI_DMA, ATMCI_DMA_CHKSIZE(3) | ATMCI_DMAEN); |
862 | 863 | ||
863 | if (data->flags & MMC_DATA_READ) | 864 | if (data->flags & MMC_DATA_READ) { |
864 | direction = DMA_FROM_DEVICE; | 865 | direction = DMA_FROM_DEVICE; |
865 | else | 866 | slave_dirn = DMA_DEV_TO_MEM; |
867 | } else { | ||
866 | direction = DMA_TO_DEVICE; | 868 | direction = DMA_TO_DEVICE; |
869 | slave_dirn = DMA_MEM_TO_DEV; | ||
870 | } | ||
867 | 871 | ||
868 | sglen = dma_map_sg(chan->device->dev, data->sg, | 872 | sglen = dma_map_sg(chan->device->dev, data->sg, |
869 | data->sg_len, direction); | 873 | data->sg_len, direction); |
870 | 874 | ||
871 | desc = chan->device->device_prep_slave_sg(chan, | 875 | desc = chan->device->device_prep_slave_sg(chan, |
872 | data->sg, sglen, direction, | 876 | data->sg, sglen, slave_dirn, |
873 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); | 877 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
874 | if (!desc) | 878 | if (!desc) |
875 | goto unmap_exit; | 879 | goto unmap_exit; |