From: Mark Brown Date: Tue, 7 Jun 2022 10:53:44 +0000 (+0100) Subject: Switch to use internal PLL for iMCLK X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=2947683c534e45090b669bda06123201ff950c49;p=linux.git Switch to use internal PLL for iMCLK Merge series from Hui Wang : Taking your advice and try to enable internal PLL to get a more accurate sample rate. And I also changed the fsl-asoc-card.c to support the nau8822 codec, now the sound quality is pretty good on my imx6sx EVB. --- 2947683c534e45090b669bda06123201ff950c49 diff --cc sound/soc/codecs/nau8822.c index f4f68b549e1ae,fd9c766e277fb..3907d1dd8ceef --- a/sound/soc/codecs/nau8822.c +++ b/sound/soc/codecs/nau8822.c @@@ -726,10 -726,13 +726,17 @@@ static int nau8822_set_pll(struct snd_s struct nau8822_pll *pll_param = &nau8822->pll; int ret, fs; + if (freq_in == pll_param->freq_in && + freq_out == pll_param->freq_out) + return 0; + + if (freq_out == 0) { + dev_dbg(component->dev, "PLL disabled\n"); + snd_soc_component_update_bits(component, + NAU8822_REG_POWER_MANAGEMENT_1, NAU8822_PLL_EN_MASK, NAU8822_PLL_OFF); + return 0; + } + fs = freq_out / 256; ret = nau8822_calc_pll(freq_in, fs, pll_param);