summaryrefslogtreecommitdiff
path: root/sound/soc/soc-pcm.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2013-06-02 02:13:53 +0400
committerMark Brown <broonie@linaro.org>2013-06-03 12:55:00 +0400
commit056790923e1c4eed5d8cc502e1092944a2b23025 (patch)
treefd9f9ecb179098f47466cb45bd770ca59a1b1727 /sound/soc/soc-pcm.c
parente4aa937ec75df0eea0bee03bffa3303ad36c986b (diff)
downloadlinux-056790923e1c4eed5d8cc502e1092944a2b23025.tar.xz
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 <fabio.estevam@freescale.com> Tested-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-pcm.c')
-rw-r--r--sound/soc/soc-pcm.c6
1 files changed, 4 insertions, 2 deletions
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;
}