aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-17 21:40:24 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-17 21:40:24 -0500
commit57f2685c16fa8e0cb86e4bc7c8ac33bfed943819 (patch)
tree96a42fe632687c8486c250c4805bf1d4c9c34d19 /drivers/mmc
parent488a9d018256dc9f29e041c0360445b6d25eea9a (diff)
parente08b881a69d638175bfa99b5af4d72b731633ea7 (diff)
Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma
* 'next' of git://git.infradead.org/users/vkoul/slave-dma: (53 commits) ARM: mach-shmobile: specify CHCLR registers on SH7372 dma: shdma: fix runtime PM: clear channel buffers on reset dma/imx-sdma: save irq flags when use spin_lock in sdma_tx_submit dmaengine/ste_dma40: clear LNK on channel startup dmaengine: intel_mid_dma: remove legacy pm interface ASoC: mxs: correct 'direction' of device_prep_dma_cyclic dmaengine: intel_mid_dma: error path fix dmaengine: intel_mid_dma: locking and freeing fixes mtd: gpmi-nand: move to dma_transfer_direction mtd: fix compile error for gpmi-nand mmc: mxs-mmc: fix the dma_transfer_direction migration dmaengine: add DMA_TRANS_NONE to dma_transfer_direction dma: mxs-dma: Don't use CLKGATE bits in CTRL0 to disable DMA channels dma: mxs-dma: make mxs_dma_prep_slave_sg() multi user safe dma: mxs-dma: Always leave mxs_dma_init() with the clock disabled. dma: mxs-dma: fix a typo in comment DMA: PL330: Remove pm_runtime_xxx calls from pl330 probe/remove video i.MX IPU: Fix display connections i.MX IPU DMA: Fix wrong burstsize settings dmaengine/ste_dma40: allow fixed physical channel ... Fix up conflicts in drivers/dma/{Kconfig,mxs-dma.c,pl330.c} The conflicts looked pretty trivial, but I'll ask people to verify them.
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/atmel-mci.c10
-rw-r--r--drivers/mmc/host/mmci.c11
-rw-r--r--drivers/mmc/host/mxcmmc.c10
-rw-r--r--drivers/mmc/host/mxs-mmc.c10
-rw-r--r--drivers/mmc/host/sh_mmcif.c4
-rw-r--r--drivers/mmc/host/tmio_mmc_dma.c4
6 files changed, 34 insertions, 15 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;
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index ece03b491c7d..0d955ffaf44e 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -374,6 +374,7 @@ static int mmci_dma_prep_data(struct mmci_host *host, struct mmc_data *data,
374 struct dma_chan *chan; 374 struct dma_chan *chan;
375 struct dma_device *device; 375 struct dma_device *device;
376 struct dma_async_tx_descriptor *desc; 376 struct dma_async_tx_descriptor *desc;
377 enum dma_data_direction buffer_dirn;
377 int nr_sg; 378 int nr_sg;
378 379
379 /* Check if next job is already prepared */ 380 /* Check if next job is already prepared */
@@ -387,10 +388,12 @@ static int mmci_dma_prep_data(struct mmci_host *host, struct mmc_data *data,
387 } 388 }
388 389
389 if (data->flags & MMC_DATA_READ) { 390 if (data->flags & MMC_DATA_READ) {
390 conf.direction = DMA_FROM_DEVICE; 391 conf.direction = DMA_DEV_TO_MEM;
392 buffer_dirn = DMA_FROM_DEVICE;
391 chan = host->dma_rx_channel; 393 chan = host->dma_rx_channel;
392 } else { 394 } else {
393 conf.direction = DMA_TO_DEVICE; 395 conf.direction = DMA_MEM_TO_DEV;
396 buffer_dirn = DMA_TO_DEVICE;
394 chan = host->dma_tx_channel; 397 chan = host->dma_tx_channel;
395 } 398 }
396 399
@@ -403,7 +406,7 @@ static int mmci_dma_prep_data(struct mmci_host *host, struct mmc_data *data,
403 return -EINVAL; 406 return -EINVAL;
404 407
405 device = chan->device; 408 device = chan->device;
406 nr_sg = dma_map_sg(device->dev, data->sg, data->sg_len, conf.direction); 409 nr_sg = dma_map_sg(device->dev, data->sg, data->sg_len, buffer_dirn);
407 if (nr_sg == 0) 410 if (nr_sg == 0)
408 return -EINVAL; 411 return -EINVAL;
409 412
@@ -426,7 +429,7 @@ static int mmci_dma_prep_data(struct mmci_host *host, struct mmc_data *data,
426 unmap_exit: 429 unmap_exit:
427 if (!next) 430 if (!next)
428 dmaengine_terminate_all(chan); 431 dmaengine_terminate_all(chan);
429 dma_unmap_sg(device->dev, data->sg, data->sg_len, conf.direction); 432 dma_unmap_sg(device->dev, data->sg, data->sg_len, buffer_dirn);
430 return -ENOMEM; 433 return -ENOMEM;
431} 434}
432 435
diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
index 7088b40f9579..4184b7946bbf 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) {
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 4e2e019dd5c9..382c835d217c 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -154,6 +154,7 @@ struct mxs_mmc_host {
154 struct dma_chan *dmach; 154 struct dma_chan *dmach;
155 struct mxs_dma_data dma_data; 155 struct mxs_dma_data dma_data;
156 unsigned int dma_dir; 156 unsigned int dma_dir;
157 enum dma_transfer_direction slave_dirn;
157 u32 ssp_pio_words[SSP_PIO_NUM]; 158 u32 ssp_pio_words[SSP_PIO_NUM];
158 159
159 unsigned int version; 160 unsigned int version;
@@ -324,7 +325,7 @@ static struct dma_async_tx_descriptor *mxs_mmc_prep_dma(
324 } 325 }
325 326
326 desc = host->dmach->device->device_prep_slave_sg(host->dmach, 327 desc = host->dmach->device->device_prep_slave_sg(host->dmach,
327 sgl, sg_len, host->dma_dir, append); 328 sgl, sg_len, host->slave_dirn, append);
328 if (desc) { 329 if (desc) {
329 desc->callback = mxs_mmc_dma_irq_callback; 330 desc->callback = mxs_mmc_dma_irq_callback;
330 desc->callback_param = host; 331 desc->callback_param = host;
@@ -356,6 +357,7 @@ static void mxs_mmc_bc(struct mxs_mmc_host *host)
356 host->ssp_pio_words[1] = cmd0; 357 host->ssp_pio_words[1] = cmd0;
357 host->ssp_pio_words[2] = cmd1; 358 host->ssp_pio_words[2] = cmd1;
358 host->dma_dir = DMA_NONE; 359 host->dma_dir = DMA_NONE;
360 host->slave_dirn = DMA_TRANS_NONE;
359 desc = mxs_mmc_prep_dma(host, 0); 361 desc = mxs_mmc_prep_dma(host, 0);
360 if (!desc) 362 if (!desc)
361 goto out; 363 goto out;
@@ -395,6 +397,7 @@ static void mxs_mmc_ac(struct mxs_mmc_host *host)
395 host->ssp_pio_words[1] = cmd0; 397 host->ssp_pio_words[1] = cmd0;
396 host->ssp_pio_words[2] = cmd1; 398 host->ssp_pio_words[2] = cmd1;
397 host->dma_dir = DMA_NONE; 399 host->dma_dir = DMA_NONE;
400 host->slave_dirn = DMA_TRANS_NONE;
398 desc = mxs_mmc_prep_dma(host, 0); 401 desc = mxs_mmc_prep_dma(host, 0);
399 if (!desc) 402 if (!desc)
400 goto out; 403 goto out;
@@ -433,6 +436,7 @@ static void mxs_mmc_adtc(struct mxs_mmc_host *host)
433 int i; 436 int i;
434 437
435 unsigned short dma_data_dir, timeout; 438 unsigned short dma_data_dir, timeout;
439 enum dma_transfer_direction slave_dirn;
436 unsigned int data_size = 0, log2_blksz; 440 unsigned int data_size = 0, log2_blksz;
437 unsigned int blocks = data->blocks; 441 unsigned int blocks = data->blocks;
438 442
@@ -448,9 +452,11 @@ static void mxs_mmc_adtc(struct mxs_mmc_host *host)
448 452
449 if (data->flags & MMC_DATA_WRITE) { 453 if (data->flags & MMC_DATA_WRITE) {
450 dma_data_dir = DMA_TO_DEVICE; 454 dma_data_dir = DMA_TO_DEVICE;
455 slave_dirn = DMA_MEM_TO_DEV;
451 read = 0; 456 read = 0;
452 } else { 457 } else {
453 dma_data_dir = DMA_FROM_DEVICE; 458 dma_data_dir = DMA_FROM_DEVICE;
459 slave_dirn = DMA_DEV_TO_MEM;
454 read = BM_SSP_CTRL0_READ; 460 read = BM_SSP_CTRL0_READ;
455 } 461 }
456 462
@@ -510,6 +516,7 @@ static void mxs_mmc_adtc(struct mxs_mmc_host *host)
510 host->ssp_pio_words[1] = cmd0; 516 host->ssp_pio_words[1] = cmd0;
511 host->ssp_pio_words[2] = cmd1; 517 host->ssp_pio_words[2] = cmd1;
512 host->dma_dir = DMA_NONE; 518 host->dma_dir = DMA_NONE;
519 host->slave_dirn = DMA_TRANS_NONE;
513 desc = mxs_mmc_prep_dma(host, 0); 520 desc = mxs_mmc_prep_dma(host, 0);
514 if (!desc) 521 if (!desc)
515 goto out; 522 goto out;
@@ -518,6 +525,7 @@ static void mxs_mmc_adtc(struct mxs_mmc_host *host)
518 WARN_ON(host->data != NULL); 525 WARN_ON(host->data != NULL);
519 host->data = data; 526 host->data = data;
520 host->dma_dir = dma_data_dir; 527 host->dma_dir = dma_data_dir;
528 host->slave_dirn = slave_dirn;
521 desc = mxs_mmc_prep_dma(host, 1); 529 desc = mxs_mmc_prep_dma(host, 1);
522 if (!desc) 530 if (!desc)
523 goto out; 531 goto out;
diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 4a2c5b2355f2..f5d8b53be333 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -286,7 +286,7 @@ static void sh_mmcif_start_dma_rx(struct sh_mmcif_host *host)
286 if (ret > 0) { 286 if (ret > 0) {
287 host->dma_active = true; 287 host->dma_active = true;
288 desc = chan->device->device_prep_slave_sg(chan, sg, ret, 288 desc = chan->device->device_prep_slave_sg(chan, sg, ret,
289 DMA_FROM_DEVICE, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); 289 DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
290 } 290 }
291 291
292 if (desc) { 292 if (desc) {
@@ -335,7 +335,7 @@ static void sh_mmcif_start_dma_tx(struct sh_mmcif_host *host)
335 if (ret > 0) { 335 if (ret > 0) {
336 host->dma_active = true; 336 host->dma_active = true;
337 desc = chan->device->device_prep_slave_sg(chan, sg, ret, 337 desc = chan->device->device_prep_slave_sg(chan, sg, ret,
338 DMA_TO_DEVICE, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); 338 DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
339 } 339 }
340 340
341 if (desc) { 341 if (desc) {
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index 86f259cdfcbc..7a6e6cc8f8b8 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -77,7 +77,7 @@ static void tmio_mmc_start_dma_rx(struct tmio_mmc_host *host)
77 ret = dma_map_sg(chan->device->dev, sg, host->sg_len, DMA_FROM_DEVICE); 77 ret = dma_map_sg(chan->device->dev, sg, host->sg_len, DMA_FROM_DEVICE);
78 if (ret > 0) 78 if (ret > 0)
79 desc = chan->device->device_prep_slave_sg(chan, sg, ret, 79 desc = chan->device->device_prep_slave_sg(chan, sg, ret,
80 DMA_FROM_DEVICE, DMA_CTRL_ACK); 80 DMA_DEV_TO_MEM, DMA_CTRL_ACK);
81 81
82 if (desc) { 82 if (desc) {
83 cookie = dmaengine_submit(desc); 83 cookie = dmaengine_submit(desc);
@@ -158,7 +158,7 @@ static void tmio_mmc_start_dma_tx(struct tmio_mmc_host *host)
158 ret = dma_map_sg(chan->device->dev, sg, host->sg_len, DMA_TO_DEVICE); 158 ret = dma_map_sg(chan->device->dev, sg, host->sg_len, DMA_TO_DEVICE);
159 if (ret > 0) 159 if (ret > 0)
160 desc = chan->device->device_prep_slave_sg(chan, sg, ret, 160 desc = chan->device->device_prep_slave_sg(chan, sg, ret,
161 DMA_TO_DEVICE, DMA_CTRL_ACK); 161 DMA_MEM_TO_DEV, DMA_CTRL_ACK);
162 162
163 if (desc) { 163 if (desc) {
164 cookie = dmaengine_submit(desc); 164 cookie = dmaengine_submit(desc);