aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-compress.c
diff options
context:
space:
mode:
authorBenoit Cousson <bcousson@baylibre.com>2014-07-08 17:19:37 -0400
committerMark Brown <broonie@linaro.org>2014-07-16 18:06:27 -0400
commit8151d5e60232d31f35e04f4e49a5b0d98b00a737 (patch)
tree193fd41cfbf6813d7ecd8566e1507e45d03ad77b /sound/soc/soc-compress.c
parent44ba2641b77ab4037b79873ea5afdac3329b1ea3 (diff)
ASoC: compress: Prevent multicodec for compressed stream
Multiple codecs does not make sense in the case of compressed stream. Exit with error if it happens. Signed-off-by: Benoit Cousson <bcousson@baylibre.com> Tested-by: Lars-Peter Clausen <lars@metafoo.de> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/soc-compress.c')
-rw-r--r--sound/soc/soc-compress.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index f96fb96b2678..27c06acce205 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -629,6 +629,11 @@ int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
629 char new_name[64]; 629 char new_name[64];
630 int ret = 0, direction = 0; 630 int ret = 0, direction = 0;
631 631
632 if (rtd->num_codecs > 1) {
633 dev_err(rtd->card->dev, "Multicodec not supported for compressed stream\n");
634 return -EINVAL;
635 }
636
632 /* check client and interface hw capabilities */ 637 /* check client and interface hw capabilities */
633 snprintf(new_name, sizeof(new_name), "%s %s-%d", 638 snprintf(new_name, sizeof(new_name), "%s %s-%d",
634 rtd->dai_link->stream_name, codec_dai->name, num); 639 rtd->dai_link->stream_name, codec_dai->name, num);