Skip to content

Commit 3d84e07

Browse files
brentlubroonie
authored andcommitted
ASoC: Intel: sof-rt5682: support bclk as PLL source on rt5682s
For rt5682s codec, we could use bclk as PLL source when the frequency is 3.072MHz but no 2.4MHz. Update the code to select correct pll_id and clk_id for 3.072MHz bclk. Reviewed-by: Bard Liao <[email protected]> Signed-off-by: Brent Lu <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 4524b1e commit 3d84e07

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

sound/soc/intel/boards/sof_rt5682.c

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -355,18 +355,23 @@ static int sof_rt5682_hw_params(struct snd_pcm_substream *substream,
355355
clk_id = RT5682_SCLK_S_PLL1;
356356
break;
357357
case CODEC_RT5682S:
358-
/*
359-
* For MCLK = 24.576MHz and sample rate = 96KHz case, use PLL1 We don't test
360-
* pll_out or params_rate() here since rt5682s PLL2 doesn't support 24.576MHz
361-
* input, so we have no choice but to use PLL1. Besides, we will not use PLL at
362-
* all if pll_in == pll_out. ex, MCLK = 24.576Mhz and sample rate = 48KHz
363-
*/
364-
if (pll_in == 24576000) {
358+
/* check plla_table and pllb_table in rt5682s.c */
359+
switch (pll_in) {
360+
case 3072000:
361+
case 24576000:
362+
/*
363+
* For MCLK = 24.576MHz and sample rate = 96KHz case, use PLL1 We don't test
364+
* pll_out or params_rate() here since rt5682s PLL2 doesn't support 24.576MHz
365+
* input, so we have no choice but to use PLL1. Besides, we will not use PLL at
366+
* all if pll_in == pll_out. ex, MCLK = 24.576Mhz and sample rate = 48KHz
367+
*/
365368
pll_id = RT5682S_PLL1;
366369
clk_id = RT5682S_SCLK_S_PLL1;
367-
} else {
370+
break;
371+
default:
368372
pll_id = RT5682S_PLL2;
369373
clk_id = RT5682S_SCLK_S_PLL2;
374+
break;
370375
}
371376
break;
372377
default:

0 commit comments

Comments
 (0)