Commit eb55fab9 authored by Mengdong Lin's avatar Mengdong Lin Committed by Mark Brown

ASoC: Intel: Select RT5672 ASRC clock source on Cherrytrail and Braswell

On Cherrytrail and Braswell, the I2S BCLK is 100FS which cannot be supported
by RT5672 in slave mode and can cause noise. This patch selects codec ASRC
clock source to track I2S1 clock so that codec ASRC can be enabled to suppress
the noise.
Signed-off-by: default avatarMengdong Lin <mengdong.lin@intel.com>
Reviewed-by: default avatarBard Liao <bardliao@realtek.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 33263027
...@@ -140,6 +140,7 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime) ...@@ -140,6 +140,7 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime)
{ {
int ret; int ret;
struct snd_soc_dai *codec_dai = runtime->codec_dai; struct snd_soc_dai *codec_dai = runtime->codec_dai;
struct snd_soc_codec *codec = codec_dai->codec;
/* TDM 4 slots 24 bit, set Rx & Tx bitmask to 4 active slots */ /* TDM 4 slots 24 bit, set Rx & Tx bitmask to 4 active slots */
ret = snd_soc_dai_set_tdm_slot(codec_dai, 0xF, 0xF, 4, 24); ret = snd_soc_dai_set_tdm_slot(codec_dai, 0xF, 0xF, 4, 24);
...@@ -148,6 +149,19 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime) ...@@ -148,6 +149,19 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime)
return ret; return ret;
} }
/* Select codec ASRC clock source to track I2S1 clock, because codec
* is in slave mode and 100fs I2S format (BCLK = 100 * LRCLK) cannot
* be supported by RT5672. Otherwise, ASRC will be disabled and cause
* noise.
*/
rt5670_sel_asrc_clk_src(codec,
RT5670_DA_STEREO_FILTER
| RT5670_DA_MONO_L_FILTER
| RT5670_DA_MONO_R_FILTER
| RT5670_AD_STEREO_FILTER
| RT5670_AD_MONO_L_FILTER
| RT5670_AD_MONO_R_FILTER,
RT5670_CLK_SEL_I2S1_ASRC);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment