Skip to content

Commit

Permalink
ASoC: rt5640: Update MCLK rate in set_sysclk()
Browse files Browse the repository at this point in the history
Simple-card/audio-graph-card drivers do not handle MCLK clock when it
is specified in the codec device node. The expectation here is that,
the codec should actually own up the MCLK clock and do necessary setup
in the driver.

This is inspired from,
commit dbf54a9 ("ASoC: rt5659: Update MCLK rate in set_sysclk()").

Cc: Oder Chiou <[email protected]>
Signed-off-by: Sameer Pujar <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
pujars authored and broonie committed Feb 9, 2023
1 parent 2512839 commit 9f138bb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sound/soc/codecs/rt5640.c
Original file line number Diff line number Diff line change
Expand Up @@ -1838,9 +1838,14 @@ static int rt5640_set_dai_sysclk(struct snd_soc_dai *dai,
struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component);
unsigned int reg_val = 0;
unsigned int pll_bit = 0;
int ret;

switch (clk_id) {
case RT5640_SCLK_S_MCLK:
ret = clk_set_rate(rt5640->mclk, freq);
if (ret)
return ret;

reg_val |= RT5640_SCLK_SRC_MCLK;
break;
case RT5640_SCLK_S_PLL1:
Expand Down

0 comments on commit 9f138bb

Please sign in to comment.