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>
(cherry picked from commit
e282d8825217c6f4ece4f9dcc2efa3421ea22b4b)
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 {