summaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorSameer Pujar <spujar@nvidia.com>2021-03-15 23:01:32 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-04-07 12:47:01 +0200
commit8b35f141b163e278d754c40635830ceaeb09f751 (patch)
tree5a4ce6f710103df13d1c95e86032946504592c8c /sound/soc
parenta58b76a34406306797072f2a4521b99929d08fe9 (diff)
downloadlinux-stable-8b35f141b163e278d754c40635830ceaeb09f751.tar.gz
linux-stable-8b35f141b163e278d754c40635830ceaeb09f751.tar.bz2
linux-stable-8b35f141b163e278d754c40635830ceaeb09f751.zip
ASoC: rt5659: Update MCLK rate in set_sysclk()
[ Upstream commit dbf54a9534350d6aebbb34f5c1c606b81a4f35dd ] 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. Suggested-by: Mark Brown <broonie@kernel.org> Suggested-by: Michael Walle <michael@walle.cc> Signed-off-by: Sameer Pujar <spujar@nvidia.com> Link: https://lore.kernel.org/r/1615829492-8972-3-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/rt5659.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/codecs/rt5659.c b/sound/soc/codecs/rt5659.c
index fa66b11df8d4..ae626d57c1ad 100644
--- a/sound/soc/codecs/rt5659.c
+++ b/sound/soc/codecs/rt5659.c
@@ -3391,12 +3391,17 @@ static int rt5659_set_dai_sysclk(struct snd_soc_dai *dai,
struct snd_soc_codec *codec = dai->codec;
struct rt5659_priv *rt5659 = snd_soc_codec_get_drvdata(codec);
unsigned int reg_val = 0;
+ int ret;
if (freq == rt5659->sysclk && clk_id == rt5659->sysclk_src)
return 0;
switch (clk_id) {
case RT5659_SCLK_S_MCLK:
+ ret = clk_set_rate(rt5659->mclk, freq);
+ if (ret)
+ return ret;
+
reg_val |= RT5659_SCLK_SRC_MCLK;
break;
case RT5659_SCLK_S_PLL1: