From patchwork Wed May 12 14:48:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 435604 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp5035535jao; Wed, 12 May 2021 10:31:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzvc6f+wsgsYfNGG6eL/mP+0qxhgURnC5yoaqA8fy3DdiLsyJbELhs4IMkSstBYK6YYtXG X-Received: by 2002:a02:c912:: with SMTP id t18mr33136772jao.100.1620840665197; Wed, 12 May 2021 10:31:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620840665; cv=none; d=google.com; s=arc-20160816; b=ySpL+P1Vw017iQgQ/DXvAhksT9OAf5HgWoypuzeFaTs1K4AEUoAPbjkVlcTvsQXOr3 VMzE3R36ab+be7GSYZXSgSIIENlcEX8XlkzNnKbeZjsLiYBef6SQ6kxHb3tZ/qrIhfET enOPf9iYe1UDFp95SqbdkpqoVAy5GspadmMXN3EXoCYOJ31ZmZE++Bikjhi4vHTH6xHB NPbE4P4zrWzEcMGNzA1MYeusUAmlb6wWcFTceqC72Xbjmy4xTTaA5HGs3KLmEsYMOyGy 9rOjgtAOeQ72177zOOBZwLk+0C4cgETfk5UtaVBvvdlP42BrrhVqxGdb3Pyg0HSrAyx0 q8eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=63vNDlSzO23XWJiGbJy+0dGLU2Cddxw6R6XvkMKt/h8=; b=nz6/J9R2q4WBvL+feyL4yYkz60haP7ZRNkeYUlvNbWoPCRwQ5wuwLaJ5Xs5/XIAyd/ V6ONVGbViupxAkJQlA8AQKGW6XapToOmTICZr9QqSQ1GAOVkdh3Xq1QW6McEDWQwhMwj xR9JVJBObfHkPdN2FngmI5djn5HxAMPR10m6ECoRgHqv7aOskaAvz6tDAveh/ViC1qav EnWSJJyvWmd/17lescdu8cchw4HzNyOVkLNx/+FH/EmK4KcuUoePyMRfw/1UK433dAg5 j7iUtRcxhuG1PYiNAHSVikVIOo7UQMC9Fk/fLQ1lXkS/eF5ZwM+FfEL05eXFNHMIDJdS 1pNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YwvDQG2v; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q8si330223ior.12.2021.05.12.10.31.05; Wed, 12 May 2021 10:31:05 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YwvDQG2v; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238902AbhELQUN (ORCPT + 12 others); Wed, 12 May 2021 12:20:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:49190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235732AbhELQOZ (ORCPT ); Wed, 12 May 2021 12:14:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4A1E461C79; Wed, 12 May 2021 15:41:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620834119; bh=hALnn+T+L39ELRVhqq9IJ5RdRHuelmI+6sKPH9+UmOU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YwvDQG2vn0U4egdn4jjX5ggbLDGZcTbMeawQp3u5IoOJXSCDPQbh+skAzOJ6HJYCg k5mayAdj36amuaOfHYWioke+lnAlHP0/QRL1Qc7jXKS8eFkNa9rdkZChmJaGmJigjX HN6vJCezMp0Ib8yIBMFAPU46WcRB7zDJF4rMdxhI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shengjiu Wang , Daniel Baluta , Charles Keepax , Mark Brown , Sasha Levin Subject: [PATCH 5.11 416/601] ASoC: wm8960: Remove bitclk relax condition in wm8960_configure_sysclk Date: Wed, 12 May 2021 16:48:13 +0200 Message-Id: <20210512144841.532296352@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144827.811958675@linuxfoundation.org> References: <20210512144827.811958675@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Shengjiu Wang [ Upstream commit 99067c07e8d877035f6249d194a317c78b7d052d ] The call sequence in wm8960_configure_clocking is ret = wm8960_configure_sysclk(); if (ret >= 0) goto configure_clock; .... ret = wm8960_configure_pll(); configure_clock: ... wm8960_configure_sysclk is called before wm8960_configure_pll, as there is bitclk relax on both functions, so wm8960_configure_sysclk always return success, then wm8960_configure_pll() never be called. With this case: aplay -Dhw:0,0 -d 5 -r 48000 -f S24_LE -c 2 audio48k24b2c.wav the required bitclk is 48000 * 24 * 2 = 2304000, bitclk got from wm8960_configure_sysclk is 3072000, but if go to wm8960_configure_pll. it can get correct bitclk 2304000. So bitclk relax condition should be removed in wm8960_configure_sysclk, then wm8960_configure_pll can be called, and there is also bitclk relax function in wm8960_configure_pll. Fixes: 3c01b9ee2ab9 ("ASoC: codec: wm8960: Relax bit clock computation") Signed-off-by: Shengjiu Wang Signed-off-by: Daniel Baluta Acked-by: Charles Keepax Link: https://lore.kernel.org/r/1614740862-30196-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/wm8960.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) -- 2.30.2 diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c index ceaf3bbb18e6..9d325555e219 100644 --- a/sound/soc/codecs/wm8960.c +++ b/sound/soc/codecs/wm8960.c @@ -608,10 +608,6 @@ static const int bclk_divs[] = { * - lrclk = sysclk / dac_divs * - 10 * bclk = sysclk / bclk_divs * - * If we cannot find an exact match for (sysclk, lrclk, bclk) - * triplet, we relax the bclk such that bclk is chosen as the - * closest available frequency greater than expected bclk. - * * @wm8960: codec private data * @mclk: MCLK used to derive sysclk * @sysclk_idx: sysclk_divs index for found sysclk @@ -629,7 +625,7 @@ int wm8960_configure_sysclk(struct wm8960_priv *wm8960, int mclk, { int sysclk, bclk, lrclk; int i, j, k; - int diff, closest = mclk; + int diff; /* marker for no match */ *bclk_idx = -1; @@ -653,12 +649,6 @@ int wm8960_configure_sysclk(struct wm8960_priv *wm8960, int mclk, *bclk_idx = k; break; } - if (diff > 0 && closest > diff) { - *sysclk_idx = i; - *dac_idx = j; - *bclk_idx = k; - closest = diff; - } } if (k != ARRAY_SIZE(bclk_divs)) break;