Browse Source

MLK-10048-1: ASoC: fsl_asrc: add protection the old version asrc

The latest asrc's channel bits is 4, bit the old asrc's channel bits is 3.
So here add protection for when using the old version asrc.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
isee-imx_3.14.28.y
Shengjiu Wang 6 years ago
committed by Nitin Garg
parent
commit
a0ff6eee4a
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      sound/soc/fsl/fsl_asrc.c

+ 2
- 1
sound/soc/fsl/fsl_asrc.c View File

@ -113,7 +113,8 @@ static int fsl_asrc_request_pair(int channels, struct fsl_asrc_pair *pair)
if (index == ASRC_INVALID_PAIR) {
dev_err(dev, "all pairs are busy now\n");
ret = -EBUSY;
} else if (asrc_priv->channel_avail < channels) {
} else if (asrc_priv->channel_avail < channels ||
(asrc_priv->channel_bits < 4 && channels % 2 != 0)) {
dev_err(dev, "can't afford required channels: %d\n", channels);
ret = -EINVAL;
} else {


Loading…
Cancel
Save