Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d25006e7 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Ulf Hansson
Browse files

mmc: sh_mmcif: Fix DMA slave address configuration



Commit e5a233cb ("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: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent b4c27763
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -386,7 +386,7 @@ sh_mmcif_request_dma_one(struct sh_mmcif_host *host,
			 struct sh_mmcif_plat_data *pdata,
			 enum dma_transfer_direction direction)
{
	struct dma_slave_config cfg;
	struct dma_slave_config cfg = { 0, };
	struct dma_chan *chan;
	unsigned int slave_id;
	struct resource *res;
@@ -417,8 +417,12 @@ sh_mmcif_request_dma_one(struct sh_mmcif_host *host,
	/* In the OF case the driver will get the slave ID from the DT */
	cfg.slave_id = slave_id;
	cfg.direction = direction;

	if (direction == DMA_DEV_TO_MEM)
		cfg.src_addr = res->start + MMCIF_CE_DATA;
	else
		cfg.dst_addr = res->start + MMCIF_CE_DATA;
	cfg.src_addr = 0;

	ret = dmaengine_slave_config(chan, &cfg);
	if (ret < 0) {
		dma_release_channel(chan);