diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-06-02 22:58:58 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-06-16 10:58:06 -0400 |
commit | 9a53581efabec8d9c69933c360e2ab036a1da9bc (patch) | |
tree | 2ea96c6092723eff8c8ba7882009a90ee1e542b4 | |
parent | 30f14b439f0cc0c7776722c0b1c2836769fe0ce7 (diff) |
ASoC: rt5677: Convert to use rl6231_calc_dmic_clk
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Tested-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | sound/soc/codecs/rt5677.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c index 1ffc6891fcbc..45f99a824c15 100644 --- a/sound/soc/codecs/rt5677.c +++ b/sound/soc/codecs/rt5677.c | |||
@@ -637,21 +637,7 @@ static int set_dmic_clk(struct snd_soc_dapm_widget *w, | |||
637 | { | 637 | { |
638 | struct snd_soc_codec *codec = w->codec; | 638 | struct snd_soc_codec *codec = w->codec; |
639 | struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec); | 639 | struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec); |
640 | int div[] = {2, 3, 4, 6, 8, 12}, idx = -EINVAL, i; | 640 | int idx = rl6231_calc_dmic_clk(rt5677->sysclk); |
641 | int rate, red, bound, temp; | ||
642 | |||
643 | rate = rt5677->sysclk; | ||
644 | red = 3000000 * 12; | ||
645 | for (i = 0; i < ARRAY_SIZE(div); i++) { | ||
646 | bound = div[i] * 3000000; | ||
647 | if (rate > bound) | ||
648 | continue; | ||
649 | temp = bound - rate; | ||
650 | if (temp < red) { | ||
651 | red = temp; | ||
652 | idx = i; | ||
653 | } | ||
654 | } | ||
655 | 641 | ||
656 | if (idx < 0) | 642 | if (idx < 0) |
657 | dev_err(codec->dev, "Failed to set DMIC clock\n"); | 643 | dev_err(codec->dev, "Failed to set DMIC clock\n"); |