ASoC: rt5677: fixed wrong DMIC ref clock
authorBard Liao <bardliao@realtek.com>
Tue, 28 Apr 2015 03:27:39 +0000 (11:27 +0800)
committerSasha Levin <sasha.levin@oracle.com>
Sun, 17 May 2015 23:12:39 +0000 (19:12 -0400)
[ Upstream commit 60a8d62b8497c23eb3d48149af7e55dac2dd83a2 ]

DMIC clock source is not from codec system clock directly. it is
generated from the division of system clock. And it should be 256 *
sample rate of AIF1.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
sound/soc/codecs/rt5677.c

index 16aa4d99a71304ea20e1c108a9e90f1c61709e45..691237a3ab520d01d9b95f64f451bf484d16b896 100644 (file)
@@ -644,7 +644,7 @@ static int set_dmic_clk(struct snd_soc_dapm_widget *w,
 {
        struct snd_soc_codec *codec = w->codec;
        struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
-       int idx = rl6231_calc_dmic_clk(rt5677->sysclk);
+       int idx = rl6231_calc_dmic_clk(rt5677->lrck[RT5677_AIF1] << 8);
 
        if (idx < 0)
                dev_err(codec->dev, "Failed to set DMIC clock\n");