aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/soc-dai.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/soc-dai.c')
-rw-r--r--sound/soc/soc-dai.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c
index 457159975b01..cecbbed2de9d 100644
--- a/sound/soc/soc-dai.c
+++ b/sound/soc/soc-dai.c
@@ -400,28 +400,30 @@ void snd_soc_dai_link_set_capabilities(struct snd_soc_dai_link *dai_link)
struct snd_soc_dai_link_component *codec;
struct snd_soc_dai *dai;
bool supported[SNDRV_PCM_STREAM_LAST + 1];
+ bool supported_cpu;
+ bool supported_codec;
int direction;
int i;
for_each_pcm_streams(direction) {
- supported[direction] = true;
+ supported_cpu = false;
+ supported_codec = false;
for_each_link_cpus(dai_link, i, cpu) {
dai = snd_soc_find_dai(cpu);
- if (!dai || !snd_soc_dai_stream_valid(dai, direction)) {
- supported[direction] = false;
+ if (dai && snd_soc_dai_stream_valid(dai, direction)) {
+ supported_cpu = true;
break;
}
}
- if (!supported[direction])
- continue;
for_each_link_codecs(dai_link, i, codec) {
dai = snd_soc_find_dai(codec);
- if (!dai || !snd_soc_dai_stream_valid(dai, direction)) {
- supported[direction] = false;
+ if (dai && snd_soc_dai_stream_valid(dai, direction)) {
+ supported_codec = true;
break;
}
}
+ supported[direction] = supported_cpu && supported_codec;
}
dai_link->dpcm_playback = supported[SNDRV_PCM_STREAM_PLAYBACK];