aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-pcm.c
diff options
context:
space:
mode:
authorQiao Zhou <zhouqiao@marvell.com>2014-11-17 03:02:57 -0500
committerMark Brown <broonie@kernel.org>2014-11-21 14:32:07 -0500
commit075207d24a394bcdb3a864446f391d4014a04cd4 (patch)
tree30acdcd0b6d1f821de73221ff48eec91a2af43b7 /sound/soc/soc-pcm.c
parentf114040e3ea6e07372334ade75d1ee0775c355e1 (diff)
ASoC: soc-pcm: skip dpcm path checking with incapable/unready FE
Skip dpcm path checking for playback or capture, if corresponding FE doesn't support playback or capture, or currently is not ready. It can reduce the unnecessary cost to search connected widgets. [Tweaked comments for clarity -- broonie] Signed-off-by: Qiao Zhou <zhouqiao@marvell.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-pcm.c')
-rw-r--r--sound/soc/soc-pcm.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 002311afdeaa..2f4f074d64a4 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -2248,7 +2248,13 @@ int soc_dpcm_runtime_update(struct snd_soc_card *card)
2248 fe->dai_link->name); 2248 fe->dai_link->name);
2249 2249
2250 /* skip if FE doesn't have playback capability */ 2250 /* skip if FE doesn't have playback capability */
2251 if (!fe->cpu_dai->driver->playback.channels_min) 2251 if (!fe->cpu_dai->driver->playback.channels_min
2252 || !fe->codec_dai->driver->playback.channels_min)
2253 goto capture;
2254
2255 /* skip if FE isn't currently playing */
2256 if (!fe->cpu_dai->playback_active
2257 || !fe->codec_dai->playback_active)
2252 goto capture; 2258 goto capture;
2253 2259
2254 paths = dpcm_path_get(fe, SNDRV_PCM_STREAM_PLAYBACK, &list); 2260 paths = dpcm_path_get(fe, SNDRV_PCM_STREAM_PLAYBACK, &list);
@@ -2278,7 +2284,13 @@ int soc_dpcm_runtime_update(struct snd_soc_card *card)
2278 dpcm_path_put(&list); 2284 dpcm_path_put(&list);
2279capture: 2285capture:
2280 /* skip if FE doesn't have capture capability */ 2286 /* skip if FE doesn't have capture capability */
2281 if (!fe->cpu_dai->driver->capture.channels_min) 2287 if (!fe->cpu_dai->driver->capture.channels_min
2288 || !fe->codec_dai->driver->capture.channels_min)
2289 continue;
2290
2291 /* skip if FE isn't currently capturing */
2292 if (!fe->cpu_dai->capture_active
2293 || !fe->codec_dai->capture_active)
2282 continue; 2294 continue;
2283 2295
2284 paths = dpcm_path_get(fe, SNDRV_PCM_STREAM_CAPTURE, &list); 2296 paths = dpcm_path_get(fe, SNDRV_PCM_STREAM_CAPTURE, &list);