summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/rt5677.c
diff options
context:
space:
mode:
authorOder Chiou <oder_chiou@realtek.com>2015-08-05 10:03:18 +0800
committerMark Brown <broonie@kernel.org>2015-08-05 10:42:35 +0100
commit00a6d6e50ff34aa2351746422e4a1c85c7765b15 (patch)
tree72798314028c5e82c692e439077acf1cfefcf39e /sound/soc/codecs/rt5677.c
parent213213d9d68e5fcb81a513a7d07ed6ee01294dea (diff)
downloadlinux-00a6d6e50ff34aa2351746422e4a1c85c7765b15.tar.gz
linux-00a6d6e50ff34aa2351746422e4a1c85c7765b15.tar.bz2
linux-00a6d6e50ff34aa2351746422e4a1c85c7765b15.zip
ASoC: Add function "rl6231_get_pre_div" to correct the dmic clock calculation
Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/rt5677.c')
-rw-r--r--sound/soc/codecs/rt5677.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c
index 31d969ac1192..f662bfd459b8 100644
--- a/sound/soc/codecs/rt5677.c
+++ b/sound/soc/codecs/rt5677.c
@@ -917,8 +917,11 @@ static int set_dmic_clk(struct snd_soc_dapm_widget *w,
{
struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
- int idx = rl6231_calc_dmic_clk(rt5677->lrck[RT5677_AIF1] << 8);
+ int idx, rate;
+ rate = rt5677->sysclk / rl6231_get_pre_div(rt5677->regmap,
+ RT5677_CLK_TREE_CTRL1, RT5677_I2S_PD1_SFT);
+ idx = rl6231_calc_dmic_clk(rate);
if (idx < 0)
dev_err(codec->dev, "Failed to set DMIC clock\n");
else