Merge remote-tracking branches 'asoc/fix/atmel', 'asoc/fix/intel', 'asoc/fix/rt5645...
[firefly-linux-kernel-4.4.55.git] / sound / soc / soc-pcm.c
index 5de2440ff25c759c7735c44e8dc06069ca6bcfc8..eb87d96e2cf0a8807e34a9859918a5c672d17981 100644 (file)
@@ -2295,7 +2295,13 @@ int soc_dpcm_runtime_update(struct snd_soc_card *card)
                        fe->dai_link->name);
 
                /* skip if FE doesn't have playback capability */
-               if (!fe->cpu_dai->driver->playback.channels_min)
+               if (!fe->cpu_dai->driver->playback.channels_min
+                   || !fe->codec_dai->driver->playback.channels_min)
+                       goto capture;
+
+               /* skip if FE isn't currently playing */
+               if (!fe->cpu_dai->playback_active
+                   || !fe->codec_dai->playback_active)
                        goto capture;
 
                paths = dpcm_path_get(fe, SNDRV_PCM_STREAM_PLAYBACK, &list);
@@ -2325,7 +2331,13 @@ int soc_dpcm_runtime_update(struct snd_soc_card *card)
                dpcm_path_put(&list);
 capture:
                /* skip if FE doesn't have capture capability */
-               if (!fe->cpu_dai->driver->capture.channels_min)
+               if (!fe->cpu_dai->driver->capture.channels_min
+                   || !fe->codec_dai->driver->capture.channels_min)
+                       continue;
+
+               /* skip if FE isn't currently capturing */
+               if (!fe->cpu_dai->capture_active
+                   || !fe->codec_dai->capture_active)
                        continue;
 
                paths = dpcm_path_get(fe, SNDRV_PCM_STREAM_CAPTURE, &list);