Skip to contentSkip to conversation

ASoC: Fix BCLK calculation of WM8994

PATCH In review Joonyoung Shim 2 participants 3 messages Feb 2, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: Fix BCLK calculation of WM8994

Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Return-Path: [email protected]
X-OriginalArrivalTime: 02 Feb 2010 09:41:49.0527 (UTC) FILETIME=[F1591670:01CAA3EB]

This fixes BCLK calculation and removes unnecessary check code.

---
 sound/soc/codecs/wm8994.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
sound/soc/codecs/wm8994.c +2 -5
index 5dd4b29..29f3771 100644
@@ -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;
Signature · 1 line
1.6.3.3
#1 lore raw
Quoted 6 lines · Joonyoung Shim

Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

This fixes BCLK calculation and removes unnecessary check code.

Sorry, dummy texts were added. Please use below patch.

Quoted 1 line

From a531baaf93e3514f92a290a2e0bdd5ea5d928a4b Mon Sep 17 00:00:00 2001

From: Joonyoung Shim <[email protected]>
Date: Tue, 2 Feb 2010 18:05:42 +0900
Subject: [PATCH] ASoC: Fix BCLK calculation of WM8994

This fixes BCLK calculation and removes unnecessary check code.

---
 sound/soc/codecs/wm8994.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
sound/soc/codecs/wm8994.c +2 -5
index 5dd4b29..29f3771 100644
@@ -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;
Signature · 1 line
1.6.3.3
#2 lore raw
Quoted 3 lines · Joonyoung Shim

This fixes BCLK calculation and removes unnecessary check code.

Oh dear, I'm a bit surprised this tested OK for me but it did. Thanks, applied.