Skip to content

Commit c3936ba

Browse files
Ravulapati Vishnu vardhan raobroonie
authored andcommitted
ASoC: amd: Added hw_params support for ALC1015
Adding rt1015 hw_params which set Bit-clock ratio, PLL and appropriate sys clk specific with RTK1015. Signed-off-by: Ravulapati Vishnu vardhan rao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent f7b2651 commit c3936ba

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

sound/soc/amd/acp3x-rt5682-max9836.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,34 @@ static int rt5682_clk_enable(struct snd_pcm_substream *substream)
127127
return ret;
128128
}
129129

130+
static int acp3x_1015_hw_params(struct snd_pcm_substream *substream,
131+
struct snd_pcm_hw_params *params)
132+
{
133+
struct snd_soc_pcm_runtime *rtd = substream->private_data;
134+
struct snd_soc_dai *codec_dai;
135+
int srate, i, ret;
136+
137+
ret = 0;
138+
srate = params_rate(params);
139+
140+
for_each_rtd_codec_dais(rtd, i, codec_dai) {
141+
if (strcmp(codec_dai->component->name, "rt1015-aif"))
142+
continue;
143+
ret = snd_soc_dai_set_bclk_ratio(codec_dai, 64);
144+
if (ret < 0)
145+
return ret;
146+
ret = snd_soc_dai_set_pll(codec_dai, 0, RT1015_PLL_S_BCLK,
147+
64 * srate, 256 * srate);
148+
if (ret < 0)
149+
return ret;
150+
ret = snd_soc_dai_set_sysclk(codec_dai, RT1015_SCLK_S_PLL,
151+
256 * srate, SND_SOC_CLOCK_IN);
152+
if (ret < 0)
153+
return ret;
154+
}
155+
return ret;
156+
}
157+
130158
static void rt5682_clk_disable(void)
131159
{
132160
clk_disable_unprepare(rt5682_dai_wclk);
@@ -232,6 +260,7 @@ static const struct snd_soc_ops acp3x_5682_ops = {
232260
static const struct snd_soc_ops acp3x_max_play_ops = {
233261
.startup = acp3x_max_startup,
234262
.shutdown = rt5682_shutdown,
263+
.hw_params = acp3x_1015_hw_params,
235264
};
236265

237266
static const struct snd_soc_ops acp3x_ec_cap0_ops = {

0 commit comments

Comments
 (0)