summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@nxp.com>2020-02-18 10:20:01 +0800
committerShengjiu Wang <shengjiu.wang@nxp.com>2020-02-18 19:11:36 +0800
commit92601d2f59da3bdc173e3a01689b056b4ce41187 (patch)
tree98e4deeb99485a5c401f3b542f42e60751828e90
parent0fff75cf2abc48ed54d6845322860feb5b4ee6c4 (diff)
LF-908-1: fsl_ssi: fix noise issue for master and mono mode
The driver will switch to normal mode for 1 channel, so the slot width is not fixed to 32 bit in this mode, and even in mono mode, the slot number is 2. But if the bit clock calulation still use the bit width=32, and slot number=1, then it cause the output frameclock is not correct. So there will be noise in output sound. This patch is to change the bit clock formula of mono mode to be 2channels * params_width * sample rate. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
-rwxr-xr-x[-rw-r--r--]sound/soc/fsl/fsl_ssi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index e4a38ebd4fc4..ee3df508dbfe 100644..100755
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -698,6 +698,10 @@ static int fsl_ssi_set_bclk(struct snd_pcm_substream *substream,
/* Generate bit clock based on the slot number and slot width */
freq = slots * slot_width * params_rate(hw_params);
+ /* The slot_width is not fixed to 32 for normal mode */
+ if (params_channels(hw_params) == 1)
+ freq = 2 * params_width(hw_params) * params_rate(hw_params);
+
/* Don't apply it to any non-baudclk circumstance */
if (IS_ERR(ssi->baudclk))
return -EINVAL;