ASoC: Intel: Enabling ASRC for RT5663 codec on kabylake platform
authorHarsha Priya N <harshapriya.n@intel.com>
Fri, 28 Jul 2017 00:41:25 +0000 (17:41 -0700)
committerMark Brown <broonie@kernel.org>
Fri, 28 Jul 2017 12:42:23 +0000 (13:42 +0100)
This patch fixes the cracking noise in rt5663 headphones for kabylake platform
by calling rt5663_sel_asrc_clk_src() for RT5663_AD_STEREO_FILTER to set ASRC.

The ASRC function is for asynchronous MCLK and LRCK. For RT5663 ASRC should be
enabled to  support special i2s clock format like Intel's 100fs.
ASRC function will track i2s clock and generate a corresponding
system clock for codec. Calling this function helps select the clock source
for both RT5663_AD_STEREO_FILTER and RT5663_DA_STEREO_FILTER filters
which fixes the crackling sound.

Signed-off-by: Harsha Priya <harshapriya.n@intel.com>
Acked-By: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c

index 3fe4a080709598dba91fa8965b1a37fd98c36b68..cfde894d250feb6c9f84e0cd49610ce2a60efb4d 100644 (file)
@@ -319,7 +319,9 @@ static int kabylake_rt5663_hw_params(struct snd_pcm_substream *substream,
        int ret;
 
        /* use ASRC for internal clocks, as PLL rate isn't multiple of BCLK */
-       rt5663_sel_asrc_clk_src(codec_dai->codec, RT5663_DA_STEREO_FILTER, 1);
+       rt5663_sel_asrc_clk_src(codec_dai->codec,
+                       RT5663_DA_STEREO_FILTER | RT5663_AD_STEREO_FILTER,
+                       RT5663_CLK_SEL_I2S1_ASRC);
 
        ret = snd_soc_dai_set_sysclk(codec_dai,
                        RT5663_SCLK_S_MCLK, 24576000, SND_SOC_CLOCK_IN);