提交 fa05899c 编写于 作者: B Bard Liao 提交者: Mark Brown

ASoC: rt5665: force using PLL if MCLK is not suitable

Idealy PLL will be set in machine driver if MCLK doesn't meet the
requirement of codec. To let the codec driver be more general, we
can use a common PLL setting once sysclk/pll doesn't set properly
in machine driver.
Signed-off-by: NBard Liao <bardliao@realtek.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 5771a8c0
...@@ -4098,9 +4098,12 @@ static int rt5665_hw_params(struct snd_pcm_substream *substream, ...@@ -4098,9 +4098,12 @@ static int rt5665_hw_params(struct snd_pcm_substream *substream,
rt5665->lrck[dai->id] = params_rate(params); rt5665->lrck[dai->id] = params_rate(params);
pre_div = rl6231_get_clk_info(rt5665->sysclk, rt5665->lrck[dai->id]); pre_div = rl6231_get_clk_info(rt5665->sysclk, rt5665->lrck[dai->id]);
if (pre_div < 0) { if (pre_div < 0) {
dev_err(codec->dev, "Unsupported clock setting %d for DAI %d\n", dev_warn(codec->dev, "Force using PLL");
rt5665->lrck[dai->id], dai->id); snd_soc_codec_set_pll(codec, 0, RT5665_PLL1_S_MCLK,
return -EINVAL; rt5665->sysclk, rt5665->lrck[dai->id] * 512);
snd_soc_codec_set_sysclk(codec, RT5665_SCLK_S_PLL1, 0,
rt5665->lrck[dai->id] * 512, 0);
pre_div = 1;
} }
frame_size = snd_soc_params_to_frame_size(params); frame_size = snd_soc_params_to_frame_size(params);
if (frame_size < 0) { if (frame_size < 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册