diff mbox

[09/10,v2] ASoC: rsnd: DMA start address is properly used for each DMAC

Message ID 87simwsap0.wl%kuninori.morimoto.gx@renesas.com (mailing list archive)
State Accepted
Commit 340371005d399b595f4044fc5e336f4a66ead101
Headers show

Commit Message

Kuninori Morimoto June 23, 2014, 12:59 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

R-Car sound uses Audio DMAC and Audio DMAC peri peri.
Audio DMAC peri peri transfers data inside circuit.

DMA transfer needs source / destination address,
and destination address can be set via dmaengine_slave_config().
The source address can be set when starting DMAEngine.
Because Audio DMAC peri peri always ignores its value,
current driver always used same source address for
Audio DMAC / Audio DMAC peri peri
(Audio DMAC peri peri source / destination address
is always fixed value)
But, This is not good match for DT booting.
This patch properly uses DMA start address
for Audio DMAC / Audio DMAC peri peri.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2

 - based on latest mark/topic/rcar

 sound/soc/sh/rcar/core.c |    2 ++
 sound/soc/sh/rcar/rsnd.h |    1 +
 2 files changed, 3 insertions(+)

Comments

Mark Brown July 2, 2014, 11:36 a.m. UTC | #1
On Sun, Jun 22, 2014 at 05:59:02PM -0700, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> R-Car sound uses Audio DMAC and Audio DMAC peri peri.
> Audio DMAC peri peri transfers data inside circuit.

Applied, thanks.
diff mbox

Patch

diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 4435a31e..49d9b31 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -200,6 +200,7 @@  void rsnd_dma_start(struct rsnd_dma *dma)
 	struct dma_async_tx_descriptor *desc;
 
 	desc = dmaengine_prep_dma_cyclic(dma->chan,
+					 (dma->addr) ? dma->addr :
 					 substream->runtime->dma_addr,
 					 snd_pcm_lib_buffer_bytes(substream),
 					 snd_pcm_lib_period_bytes(substream),
@@ -347,6 +348,7 @@  int rsnd_dma_init(struct rsnd_priv *priv, struct rsnd_dma *dma,
 	if (ret < 0)
 		goto rsnd_dma_init_err;
 
+	dma->addr = is_play ? cfg.src_addr : cfg.dst_addr;
 	dma->dir = is_play ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM;
 
 	return 0;
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
index 425b22e..631b149 100644
--- a/sound/soc/sh/rcar/rsnd.h
+++ b/sound/soc/sh/rcar/rsnd.h
@@ -158,6 +158,7 @@  struct rsnd_dma {
 	struct sh_dmae_slave	slave;
 	struct dma_chan		*chan;
 	enum dma_transfer_direction dir;
+	dma_addr_t		addr;
 };
 
 void rsnd_dma_start(struct rsnd_dma *dma);