aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2014-07-15 18:45:12 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2014-07-26 05:38:19 -0400
commitd25006e7e5045e76575e9f58903efc1a860a3ff1 (patch)
tree586a354b5cd3dbaf6907a39b5013a0a08df2d624 /drivers/mmc
parentb4c27763d749ab3a4dddfcfd44dc5af15bb91a0e (diff)
mmc: sh_mmcif: Fix DMA slave address configuration
Commit e5a233cb647d749de2f188477c9a54b94d90477f ("mmc: sh_mmcif: Factorize DMA channel request and configuration code") incorrectly set the destination address for both slave channels instead of setting the source address for the receive channel. Fix that. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sh_mmcif.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 0289b4ecccb3..863d21ee4a2f 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -386,7 +386,7 @@ sh_mmcif_request_dma_one(struct sh_mmcif_host *host,
386 struct sh_mmcif_plat_data *pdata, 386 struct sh_mmcif_plat_data *pdata,
387 enum dma_transfer_direction direction) 387 enum dma_transfer_direction direction)
388{ 388{
389 struct dma_slave_config cfg; 389 struct dma_slave_config cfg = { 0, };
390 struct dma_chan *chan; 390 struct dma_chan *chan;
391 unsigned int slave_id; 391 unsigned int slave_id;
392 struct resource *res; 392 struct resource *res;
@@ -417,8 +417,12 @@ sh_mmcif_request_dma_one(struct sh_mmcif_host *host,
417 /* In the OF case the driver will get the slave ID from the DT */ 417 /* In the OF case the driver will get the slave ID from the DT */
418 cfg.slave_id = slave_id; 418 cfg.slave_id = slave_id;
419 cfg.direction = direction; 419 cfg.direction = direction;
420 cfg.dst_addr = res->start + MMCIF_CE_DATA; 420
421 cfg.src_addr = 0; 421 if (direction == DMA_DEV_TO_MEM)
422 cfg.src_addr = res->start + MMCIF_CE_DATA;
423 else
424 cfg.dst_addr = res->start + MMCIF_CE_DATA;
425
422 ret = dmaengine_slave_config(chan, &cfg); 426 ret = dmaengine_slave_config(chan, &cfg);
423 if (ret < 0) { 427 if (ret < 0) {
424 dma_release_channel(chan); 428 dma_release_channel(chan);