Commit a0ff6eee by Shengjiu Wang Committed by Nitin Garg

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: 's avatarShengjiu Wang <shengjiu.wang@freescale.com>
parent f3c7b834
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment