summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@freescale.com>2017-05-03 10:57:10 +0800
committerJason Liu <jason.hui.liu@nxp.com>2019-02-12 10:26:23 +0800
commit206528bdfff337bd322712e4727ac9749ffb3a65 (patch)
tree46cbba44895fcc06a7b71b56e2c3428ace6bcb45
parent76fbf3981e0b19b1f52ae9e6916c007d48918358 (diff)
MLK-14781-1: ASoC: fsl_ssi: fix noise issue for master and mono mode
The case is 32kHz/24bit/1channel bit stream, and ssi is in master 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 the bit clock calulation still use the bit width=32, and slot number=1, which 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, which is 2channels * params_width * sample rate. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
-rw-r--r--sound/soc/fsl/fsl_ssi.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 18f7930e5e53..752b4af5f648 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -726,8 +726,14 @@ static int fsl_ssi_set_bclk(struct snd_pcm_substream *substream,
/* Prefer the explicitly set bitclock frequency */
if (ssi_private->bitclk_freq)
freq = ssi_private->bitclk_freq;
- else
- freq = params_channels(hw_params) * 32 * params_rate(hw_params);
+ else {
+ if (params_channels(hw_params) == 1)
+ freq = 2 * params_width(hw_params) *
+ params_rate(hw_params);
+ else
+ freq = params_channels(hw_params) * 32 *
+ params_rate(hw_params);
+ }
/* Don't apply it to any non-baudclk circumstance */
if (IS_ERR(ssi_private->baudclk))