[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231206110620.1695591-7-venkataprasad.potturu@amd.com>
Date: Wed, 6 Dec 2023 16:36:18 +0530
From: Venkata Prasad Potturu <venkataprasad.potturu@....com>
To: <broonie@...nel.org>, <alsa-devel@...a-project.org>
CC: <Vijendar.Mukunda@....com>, <Basavaraj.Hiregoudar@....com>,
<Sunil-kumar.Dommati@....com>, <syed.sabakareem@....com>,
"Venkata Prasad Potturu" <venkataprasad.potturu@....com>,
Liam Girdwood <lgirdwood@...il.com>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
"Alper Nebi Yasak" <alpernebiyasak@...il.com>,
Syed Saba Kareem <Syed.SabaKareem@....com>,
Marian Postevca <posteuca@...ex.one>,
Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>,
"open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..."
<linux-sound@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: [PATCH 7/7] 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@....com>
---
sound/soc/amd/acp/acp-mach-common.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/sound/soc/amd/acp/acp-mach-common.c b/sound/soc/amd/acp/acp-mach-common.c
index b72beb8e9b13..74e83c2dae53 100644
--- a/sound/soc/amd/acp/acp-mach-common.c
+++ b/sound/soc/amd/acp/acp-mach-common.c
@@ -464,6 +464,22 @@ static int acp_card_rt5682s_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) {
--
2.25.1
Powered by blists - more mailing lists