From: Mark Brown Date: Sat, 1 Jun 2013 22:13:53 +0000 (+0100) Subject: ASoC: pcm: Require both CODEC and CPU support when declaring stream caps X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=056790923e1c4eed5d8cc502e1092944a2b23025;p=linux-beck.git ASoC: pcm: Require both CODEC and CPU support when declaring stream caps When declaring playback and capture capabilities check for both CODEC side and CPU side support rather than only checking for CODEC side support. While it is unusual some CPUs do have unidirectional DAIs. Reported-by: Fabio Estevam Tested-by: Fabio Estevam Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 73bb8eefa491..a9fddf0fea19 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2011,9 +2011,11 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num) if (cpu_dai->driver->capture.channels_min) capture = 1; } else { - if (codec_dai->driver->playback.channels_min) + if (codec_dai->driver->playback.channels_min && + cpu_dai->driver->playback.channels_min) playback = 1; - if (codec_dai->driver->capture.channels_min) + if (codec_dai->driver->capture.channels_min && + cpu_dai->driver->capture.channels_min) capture = 1; }