1
0
Fork 0

MLK-14851: ASoC: wm8962: fix clock issue for S20_3LE (part 1)

There is error log "wm8962 3-001a: Unsupported BCLK ratio 6"
When the bitstream's format is S20_3LE.
The reason is that the pll output is samplerate*256, which
can't divide to clock samplerate*20*2. So in this patch change
the pll output to samplerate*384, and use the physical_width
for S20_3LE to calculate the bclk.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
[ Aisheng: split card changes ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Shengjiu Wang 2017-05-08 15:15:44 +08:00 committed by Dong Aisheng
parent f372be5c8a
commit 0a37960199
1 changed files with 8 additions and 1 deletions

View File

@ -3,6 +3,7 @@
* wm8962.c -- WM8962 ALSA SoC Audio driver
*
* Copyright 2010-2 Wolfson Microelectronics plc
* Copyright 2017 NXP
*
* Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
*/
@ -2557,11 +2558,17 @@ static int wm8962_hw_params(struct snd_pcm_substream *substream,
{
struct snd_soc_component *component = dai->component;
struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component);
snd_pcm_format_t sample_format = params_format(params);
int i;
int aif0 = 0;
int adctl3 = 0;
wm8962->bclk = snd_soc_params_to_bclk(params);
if (sample_format == SNDRV_PCM_FORMAT_S20_3LE)
wm8962->bclk = params_rate(params) *
params_channels(params) *
params_physical_width(params);
else
wm8962->bclk = snd_soc_params_to_bclk(params);
if (params_channels(params) == 1)
wm8962->bclk *= 2;