summaryrefslogtreecommitdiff
path: root/sound/soc/amd
diff options
context:
space:
mode:
authorVenkata Prasad Potturu <venkataprasad.potturu@amd.com>2023-12-06 16:36:18 +0530
committerMark Brown <broonie@kernel.org>2023-12-06 22:28:55 +0000
commit14b4b5fd3d7aac2f17800b821a0fac30d705a25d (patch)
tree2a9e8321550e1a1e6a785396e67ec45674784c4c /sound/soc/amd
parentff5a698c0ffb08eee9c1ce0dfc79c91f273122d5 (diff)
ASoC: amd: acp: Set bclk as source to set pll for rt5682s codec
Some platforms doesn't have reference mclk pin to codec, so set bclk as a clk source for rt5682s codec pll in tdm mode. Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com> Link: https://lore.kernel.org/r/20231206110620.1695591-7-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/amd')
-rw-r--r--sound/soc/amd/acp/acp-mach-common.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sound/soc/amd/acp/acp-mach-common.c b/sound/soc/amd/acp/acp-mach-common.c
index 74e83c2dae53..f7bcf210f0fd 100644
--- a/sound/soc/amd/acp/acp-mach-common.c
+++ b/sound/soc/amd/acp/acp-mach-common.c
@@ -282,6 +282,22 @@ static int acp_card_rt5682_hw_params(struct snd_pcm_substream *substream,
return ret;
}
+ if (drvdata->tdm_mode) {
+ ret = snd_soc_dai_set_pll(codec_dai, RT5682S_PLL1, RT5682S_PLL_S_BCLK1,
+ 6144000, 49152000);
+ if (ret < 0) {
+ dev_err(rtd->dev, "Failed to set codec PLL: %d\n", ret);
+ return ret;
+ }
+
+ ret = snd_soc_dai_set_sysclk(codec_dai, RT5682S_SCLK_S_PLL1,
+ 49152000, SND_SOC_CLOCK_IN);
+ if (ret < 0) {
+ dev_err(rtd->dev, "Failed to set codec SYSCLK: %d\n", ret);
+ return ret;
+ }
+ }
+
/* Set tdm/i2s1 master bclk ratio */
ret = snd_soc_dai_set_bclk_ratio(codec_dai, ch * format);
if (ret < 0) {