Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4630189pxj; Wed, 12 May 2021 09:36:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9QY1F2tTNZ0MmnX48qqkZEDEuFmcf2G/4Slk42c5+lUud1gpLj+lIyeF5vaGUg9Ni+76u X-Received: by 2002:a17:906:c453:: with SMTP id ck19mr39384960ejb.439.1620837389223; Wed, 12 May 2021 09:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620837389; cv=none; d=google.com; s=arc-20160816; b=OM1sWMh6bNcpZ9a+rfuc9LJur/TtFo6YYoM/AwJi3xExe10Tze0XwjP6Xi7hV73Ucr fcr08IeZLwwIC4NBeU1bFiS4JqeHrwwNMSQtQ6RcrTqQsYT8/W4oVEJDD8R6DRI7k019 gSpWHPSdWSQIdeksD+iPI4rct+0Qmsqjwd8aWdxic/JBAAr3Sgi9/H3jp9++9ZtXa9C+ OKVLGvbK6J+2h+gYDQ6W6afGpujbWsx56FBCnJRN5W3H7UjW+jH1jijP6O/r4OeaB40j 71oPdt4J7RDq5a5j5ZbIjelWBdfeMZGKOIK671/haiH39m5Mh94Mfoksn+8hhsCs1Jz/ rGqQ== 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=yrO4tnIL2UrdHnzMynu/RriUuqUt3j4osvZH1x1MFNAALPSDnxkynbUMng8bROesc0 IMYp/6jvoLiOUr/CsB6F1M0LG3J7cMmZDo+CJxUXz3aco/uVTU6tGFiYBHOiAk8Dm5AG /H+IQWlLtBw9zX2aHkEn97lJsll0DO3YVsv28+AZeT3XI4KpJ0zCLeUaTLh+PpLBEqou WdX134DXcsZIw9CLbos2rs1vibzJCSXD7BrSvXvZnssHQzHFLRXdBu4uCr8qS1xcJ5kS Zu9PYpeMbCghebVaTXFpLp2vMmyGIBIXBOzyfQBsV/IbyWg0+CWbwF8cECzh85DNN6nz e47Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=R2bmt2vz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 s14si160528edd.602.2021.05.12.09.36.04; Wed, 12 May 2021 09:36:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=R2bmt2vz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S239675AbhELQY4 (ORCPT + 99 others); Wed, 12 May 2021 12:24:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:56350 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236300AbhELPhe (ORCPT ); Wed, 12 May 2021 11:37:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CC87361C59; Wed, 12 May 2021 15:19:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832744; bh=hALnn+T+L39ELRVhqq9IJ5RdRHuelmI+6sKPH9+UmOU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R2bmt2vzFE/IGwG/q/RjW5jsI81SsoSOU2tI5HXUidSrBTb+OSOG0SszqciDhvMSu o0b6QY4pe+6kHTFDv+nBY9UL/swrwk/qKlxSRVAZjALIIIAMqrz3gHo9VQhyomo17x qACT5reQZWvZQCC29kXcDKilexVwdhOMhu+5t7YY= 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.10 371/530] ASoC: wm8960: Remove bitclk relax condition in wm8960_configure_sysclk Date: Wed, 12 May 2021 16:48:01 +0200 Message-Id: <20210512144831.973693687@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) 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; -- 2.30.2