[alsa-devel] [PATCH] ASoC: imx: Open code dma channel request

Mark Brown broonie at kernel.org
Sat Oct 19 22:02:13 CEST 2013


From: Mark Brown <broonie at linaro.org>

Currently the imx DMA code is one of the few users relying on the fact
that the compat code uses the dma_data as the filter data for non-DT
channel requests. Since the rest of the core expects this to be a struct
snd_dmaengine_dai_data this isn't terribly helpful this will be changed to
use the already existing filter data so avoid breaking imx by open
coding the current behaviour.

Signed-off-by: Mark Brown <broonie at linaro.org>
---
 sound/soc/fsl/imx-pcm-dma.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/sound/soc/fsl/imx-pcm-dma.c b/sound/soc/fsl/imx-pcm-dma.c
index 4dc1296..318f1fc 100644
--- a/sound/soc/fsl/imx-pcm-dma.c
+++ b/sound/soc/fsl/imx-pcm-dma.c
@@ -35,6 +35,17 @@ static bool filter(struct dma_chan *chan, void *param)
 	return true;
 }
 
+static struct dma_chan *imx_compat_request_channel(
+	struct snd_soc_pcm_runtime *rtd,
+	struct snd_pcm_substream *substream)
+{
+	struct snd_dmaengine_dai_dma_data *dma_data;
+
+	dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
+
+	return snd_dmaengine_pcm_request_channel(filter, dma_data);
+}
+
 static const struct snd_pcm_hardware imx_pcm_hardware = {
 	.info = SNDRV_PCM_INFO_INTERLEAVED |
 		SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -58,6 +69,7 @@ static const struct snd_dmaengine_pcm_config imx_dmaengine_pcm_config = {
 	.pcm_hardware = &imx_pcm_hardware,
 	.prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config,
 	.compat_filter_fn = filter,
+	.compat_request_channel = imx_compat_request_channel,
 	.prealloc_buffer_size = IMX_SSI_DMABUF_SIZE,
 };
 
-- 
1.8.4.rc3



More information about the Alsa-devel mailing list