aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2011-02-10 10:09:29 -0500
committerChris Ball <cjb@laptop.org>2011-03-15 13:49:09 -0400
commit1ed828dbb4a90f273b2a3cc70c9c28306427ea7c (patch)
tree63d5680c417f40c9da88300a01d86ee4f489075c
parent5328906aa2e54a7a5e99e1ba8ee52b387e8be44b (diff)
mmc: sh_mmcif: map DMA buffers on the DMA engine device
As established for the MMCI, it is proper to map the DMA buffers on the DMA engine which is the one actually performing the DMA. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r--drivers/mmc/host/sh_mmcif.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 12884c270171..8e4aba90d6a4 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -194,10 +194,12 @@ static void mmcif_dma_complete(void *arg)
194 return; 194 return;
195 195
196 if (host->data->flags & MMC_DATA_READ) 196 if (host->data->flags & MMC_DATA_READ)
197 dma_unmap_sg(&host->pd->dev, host->data->sg, host->dma_sglen, 197 dma_unmap_sg(host->chan_rx->device->dev,
198 host->data->sg, host->dma_sglen,
198 DMA_FROM_DEVICE); 199 DMA_FROM_DEVICE);
199 else 200 else
200 dma_unmap_sg(&host->pd->dev, host->data->sg, host->dma_sglen, 201 dma_unmap_sg(host->chan_tx->device->dev,
202 host->data->sg, host->dma_sglen,
201 DMA_TO_DEVICE); 203 DMA_TO_DEVICE);
202 204
203 complete(&host->dma_complete); 205 complete(&host->dma_complete);
@@ -211,7 +213,8 @@ static void sh_mmcif_start_dma_rx(struct sh_mmcif_host *host)
211 dma_cookie_t cookie = -EINVAL; 213 dma_cookie_t cookie = -EINVAL;
212 int ret; 214 int ret;
213 215
214 ret = dma_map_sg(&host->pd->dev, sg, host->data->sg_len, DMA_FROM_DEVICE); 216 ret = dma_map_sg(chan->device->dev, sg, host->data->sg_len,
217 DMA_FROM_DEVICE);
215 if (ret > 0) { 218 if (ret > 0) {
216 host->dma_sglen = ret; 219 host->dma_sglen = ret;
217 desc = chan->device->device_prep_slave_sg(chan, sg, ret, 220 desc = chan->device->device_prep_slave_sg(chan, sg, ret,
@@ -263,7 +266,8 @@ static void sh_mmcif_start_dma_tx(struct sh_mmcif_host *host)
263 dma_cookie_t cookie = -EINVAL; 266 dma_cookie_t cookie = -EINVAL;
264 int ret; 267 int ret;
265 268
266 ret = dma_map_sg(&host->pd->dev, sg, host->data->sg_len, DMA_TO_DEVICE); 269 ret = dma_map_sg(chan->device->dev, sg, host->data->sg_len,
270 DMA_TO_DEVICE);
267 if (ret > 0) { 271 if (ret > 0) {
268 host->dma_sglen = ret; 272 host->dma_sglen = ret;
269 desc = chan->device->device_prep_slave_sg(chan, sg, ret, 273 desc = chan->device->device_prep_slave_sg(chan, sg, ret,