]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - sound/soc/soc-generic-dmaengine-pcm.c
Merge tag 'trace-v4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
[karo-tx-linux.git] / sound / soc / soc-generic-dmaengine-pcm.c
index 17eb14935577764a59b9dd06e27cf515ce850ab8..d53786498b61238cd8a6ade0481df8f65a9626bd 100644 (file)
@@ -263,6 +263,7 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd)
        struct dmaengine_pcm *pcm = soc_platform_to_pcm(rtd->platform);
        const struct snd_dmaengine_pcm_config *config = pcm->config;
        struct device *dev = rtd->platform->dev;
+       struct snd_dmaengine_dai_dma_data *dma_data;
        struct snd_pcm_substream *substream;
        size_t prealloc_buffer_size;
        size_t max_buffer_size;
@@ -282,6 +283,13 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd)
                if (!substream)
                        continue;
 
+               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->chan[i] = dma_request_slave_channel(dev,
+                               dma_data->chan_name);
+
                if (!pcm->chan[i] && (pcm->flags & SND_DMAENGINE_PCM_FLAG_COMPAT)) {
                        pcm->chan[i] = dmaengine_pcm_compat_request_channel(rtd,
                                substream);
@@ -350,7 +358,9 @@ static int dmaengine_pcm_request_chan_of(struct dmaengine_pcm *pcm,
        const char *name;
        struct dma_chan *chan;
 
-       if ((pcm->flags & SND_DMAENGINE_PCM_FLAG_NO_DT) || !dev->of_node)
+       if ((pcm->flags & (SND_DMAENGINE_PCM_FLAG_NO_DT |
+                          SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME)) ||
+           !dev->of_node)
                return 0;
 
        if (config && config->dma_dev) {