aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/mxcmmc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/host/mxcmmc.c')
-rw-r--r--drivers/mmc/host/mxcmmc.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
index 325ea61e12d..a17bc121785 100644
--- a/drivers/mmc/host/mxcmmc.c
+++ b/drivers/mmc/host/mxcmmc.c
@@ -218,6 +218,7 @@ static int mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data)
218 unsigned int blksz = data->blksz; 218 unsigned int blksz = data->blksz;
219 unsigned int datasize = nob * blksz; 219 unsigned int datasize = nob * blksz;
220 struct scatterlist *sg; 220 struct scatterlist *sg;
221 enum dma_transfer_direction slave_dirn;
221 int i, nents; 222 int i, nents;
222 223
223 if (data->flags & MMC_DATA_STREAM) 224 if (data->flags & MMC_DATA_STREAM)
@@ -240,10 +241,13 @@ static int mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data)
240 } 241 }
241 } 242 }
242 243
243 if (data->flags & MMC_DATA_READ) 244 if (data->flags & MMC_DATA_READ) {
244 host->dma_dir = DMA_FROM_DEVICE; 245 host->dma_dir = DMA_FROM_DEVICE;
245 else 246 slave_dirn = DMA_DEV_TO_MEM;
247 } else {
246 host->dma_dir = DMA_TO_DEVICE; 248 host->dma_dir = DMA_TO_DEVICE;
249 slave_dirn = DMA_MEM_TO_DEV;
250 }
247 251
248 nents = dma_map_sg(host->dma->device->dev, data->sg, 252 nents = dma_map_sg(host->dma->device->dev, data->sg,
249 data->sg_len, host->dma_dir); 253 data->sg_len, host->dma_dir);
@@ -251,7 +255,7 @@ static int mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data)
251 return -EINVAL; 255 return -EINVAL;
252 256
253 host->desc = host->dma->device->device_prep_slave_sg(host->dma, 257 host->desc = host->dma->device->device_prep_slave_sg(host->dma,
254 data->sg, data->sg_len, host->dma_dir, 258 data->sg, data->sg_len, slave_dirn,
255 DMA_PREP_INTERRUPT | DMA_CTRL_ACK); 259 DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
256 260
257 if (!host->desc) { 261 if (!host->desc) {