Skip to content

Commit

Permalink
ASoC: compress: Prevent multicodec for compressed stream
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Benoit Cousson authored and Mark Brown committed Jul 16, 2014
1 parent 44ba264 commit 8151d5e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sound/soc/soc-compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,11 @@ int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
char new_name[64];
int ret = 0, direction = 0;

if (rtd->num_codecs > 1) {
dev_err(rtd->card->dev, "Multicodec not supported for compressed stream\n");
return -EINVAL;
}

/* check client and interface hw capabilities */
snprintf(new_name, sizeof(new_name), "%s %s-%d",
rtd->dai_link->stream_name, codec_dai->name, num);
Expand Down

0 comments on commit 8151d5e

Please sign in to comment.