From: Sylwester Nawrocki Date: Thu, 7 Feb 2019 17:00:10 +0000 (+0100) Subject: ASoC: dmaengine: Extend use of chan_names provided in custom DMA config X-Git-Tag: accepted/tizen/unified/20190330.030053~51 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8088d62a54972f6d3ff891965141c64425f383ac;p=platform%2Fkernel%2Flinux-exynos.git ASoC: dmaengine: Extend use of chan_names provided in custom DMA config There are currently two ways to specify custom DMA channel names: - through the SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME flag and snd_dmaengine_dai_dma_data data structure, - through chan_names field of struct snd_dmaengine_pcm_config. In order to replace the DAI DMA data method with the custom DMA config one on non-DT platforms the dmaengine_pcm_new() function is extended to also consider channel names specified in the custom DMA config. If both config->chan_names and dma_data->chan_name are provided the former will be used. Change-Id: I6a325754971c7d4daf3141f3cfeede9280d9941c Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c index 613ed8c..06d4dfc 100644 --- a/sound/soc/soc-generic-dmaengine-pcm.c +++ b/sound/soc/soc-generic-dmaengine-pcm.c @@ -286,9 +286,16 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd) dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); if (!pcm->chan[i] && - (pcm->flags & SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME)) + ((pcm->flags & SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME) || + (config && config->chan_names[i]))) { + const char *chan_name = dma_data->chan_name; + + if (config && config->chan_names[i]) + chan_name = config->chan_names[i]; + pcm->chan[i] = dma_request_slave_channel(dev, - dma_data->chan_name); + chan_name); + } if (!pcm->chan[i] && (pcm->flags & SND_DMAENGINE_PCM_FLAG_COMPAT)) { pcm->chan[i] = dmaengine_pcm_compat_request_channel(rtd,