OSDN Git Service

ASoC: rsnd: add rsnd_dma_alloc()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Wed, 20 Sep 2017 06:28:44 +0000 (06:28 +0000)
committerMark Brown <broonie@kernel.org>
Thu, 21 Sep 2017 16:50:48 +0000 (17:50 +0100)
commit81cb71240e202a8086bda0755d9d78bd3decd0aa
tree9003cdead803748256eadac2060f727c25faf9a5
parentb7165d26bf730567ab081bb9383aff82cd43d9ea
ASoC: rsnd: add rsnd_dma_alloc()

R-Car sound DMA will be used from SSI/SRC.
dma.c doesn't alloc DMA handler in .probe timing, because we don't
know what kind of DMA transfer will be used then.
Thus, SSI/SRC have *rsnd_mod for DMA. rsnd_dma_attach() will allocate
it and attach it to system.
It will be PIO mode if it can't alloc DMA handler.

In case of MIX is used, rsnd_dma_attach() will be called twice from SSI.
To avoid duplicate allocation, current rsnd_dma_attach() is checking
allocated DMA handler. This DMA related operation is a little bit
difficult to understand.
This patch adds new rsnd_dma_alloc() and separates allocation and attach
for readable code.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sh/rcar/dma.c