From 92601d2f59da3bdc173e3a01689b056b4ce41187 Mon Sep 17 00:00:00 2001 From: Shengjiu Wang Date: Tue, 18 Feb 2020 10:20:01 +0800 Subject: 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 Reviewed-by: Viorel Suman --- sound/soc/fsl/fsl_ssi.c | 4 ++++ 1 file changed, 4 insertions(+) mode change 100644 => 100755 sound/soc/fsl/fsl_ssi.c diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c old mode 100644 new mode 100755 index e4a38ebd4fc4..ee3df508dbfe --- 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; -- cgit v1.2.3