diff options
author | Shengjiu Wang <shengjiu.wang@freescale.com> | 2014-12-08 13:03:17 +0800 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2015-01-15 21:18:51 -0600 |
commit | a0ff6eee4a12e5fbb7139d2d60e46944647287a8 (patch) | |
tree | 75e5027c23d8a29518b1bdc18acfe872c89f7a78 /sound | |
parent | f3c7b8348d0528c111648560668a010b737444fa (diff) |
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>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/fsl/fsl_asrc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c index 832e822d1c9f..3c2c69c78ebd 100644 --- a/sound/soc/fsl/fsl_asrc.c +++ b/sound/soc/fsl/fsl_asrc.c @@ -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 { |