From 07cd8ada1aba5556b0d5d2264ce0f40d1ff1d131 Mon Sep 17 00:00:00 2001 From: Joonyoung Shim Date: Tue, 2 Feb 2010 18:53:19 +0900 Subject: ASoC: Fix BCLK calculation of WM8994 This fixes BCLK calculation and removes unnecessary check code. Signed-off-by: Joonyoung Shim Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/codecs/wm8994.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 5dd4b299f69e..29f3771c33a4 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c @@ -3267,15 +3267,12 @@ static int wm8994_hw_params(struct snd_pcm_substream *substream, */ best = 0; for (i = 0; i < ARRAY_SIZE(bclk_divs); i++) { - if (bclk_divs[i] < 0) - continue; - cur_val = (wm8994->aifclk[id] * 10 / bclk_divs[i]) - - bclk_rate * 10; + cur_val = (wm8994->aifclk[id] * 10 / bclk_divs[i]) - bclk_rate; if (cur_val < 0) /* BCLK table is sorted */ break; best = i; } - bclk_rate = wm8994->aifclk[id] / bclk_divs[best]; + bclk_rate = wm8994->aifclk[id] * 10 / bclk_divs[best]; dev_dbg(dai->dev, "Using BCLK_DIV %d for actual BCLK %dHz\n", bclk_divs[best], bclk_rate); bclk |= best << WM8994_AIF1_BCLK_DIV_SHIFT; -- cgit v1.2.3