summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@freescale.com>2017-06-15 13:07:20 +0800
committerShengjiu Wang <shengjiu.wang@freescale.com>2017-06-15 17:51:44 +0800
commit52a91e870b8cc95cbceeda205761134e25626863 (patch)
tree70188cd33658d84ef96cb0ab4e3ffa0b08b0445d /sound
parent22a06ef13c3da1e104476926ce630f164ef129cb (diff)
MLK-15068: ASoC: fsl_ssi: fix the noise issue with S20_3LE Mono bitsream
In master mode, clock of S20_3LE mono bistream is calculated by formula "2 * params_width * params_rate", and this clock can't be divided from clock soure, so switch to use the "2 * params_physical_width * params_rate" formula to fix this issue. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Diffstat (limited to 'sound')
-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 98226bcf2afd..2f487874237f 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -722,17 +722,23 @@ static int fsl_ssi_set_bclk(struct snd_pcm_substream *substream,
u64 sub, savesub = 100000;
unsigned int freq;
bool baudclk_is_used;
+ snd_pcm_format_t sample_format = params_format(hw_params);
/* Prefer the explicitly set bitclock frequency */
if (ssi_private->bitclk_freq)
freq = ssi_private->bitclk_freq;
else {
- if (params_channels(hw_params) == 1)
+ if (params_channels(hw_params) == 1) {
freq = 2 * params_width(hw_params) *
params_rate(hw_params);
- else
+
+ if (sample_format == SNDRV_PCM_FORMAT_S20_3LE)
+ freq = 2 * params_physical_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 */