Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ASoC: fsl_asrc: old version asrc only support even numbered channels
@ 2015-12-24  3:42 Zidan Wang
  2015-12-24  3:42 ` [PATCH v3] ASoC: fsl_asrc: sound is wrong after suspend/resume Zidan Wang
  0 siblings, 1 reply; 4+ messages in thread
From: Zidan Wang @ 2015-12-24  3:42 UTC (permalink / raw)
  To: broonie; +Cc: alsa-devel, Zidan Wang, Xiubo.Lee, tiwai, nicoleotsuka

The latest asrc's channel bits is 4 bit, the old asrc's channel
bits is 3. For the old version asrc, channel should be a even number.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
---
v1->v2:
1. add an extra else if for the new condition.

 sound/soc/fsl/fsl_asrc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
index be78dc9..d7d81cf 100644
--- a/sound/soc/fsl/fsl_asrc.c
+++ b/sound/soc/fsl/fsl_asrc.c
@@ -116,6 +116,9 @@ static int fsl_asrc_request_pair(int channels, struct fsl_asrc_pair *pair)
 	} else if (asrc_priv->channel_avail < channels) {
 		dev_err(dev, "can't afford required channels: %d\n", channels);
 		ret = -EINVAL;
+	} else if (asrc_priv->channel_bits < 4 && channels % 2 != 0) {
+		dev_err(dev, "old version asrc can't support an odd channel number");
+		ret = -EINVAL;
 	} else {
 		asrc_priv->channel_avail -= channels;
 		asrc_priv->pair[index] = pair;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-01-05 17:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-24  3:42 [PATCH v2] ASoC: fsl_asrc: old version asrc only support even numbered channels Zidan Wang
2015-12-24  3:42 ` [PATCH v3] ASoC: fsl_asrc: sound is wrong after suspend/resume Zidan Wang
2016-01-05 13:18   ` Mark Brown
2016-01-05 17:49   ` Applied "ASoC: fsl_asrc: sound is wrong after suspend/resume" to the asoc tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox