Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp3575250pxb; Tue, 7 Sep 2021 02:54:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0D71gdt9BJyp7PXlJ/bRkDDSLG1rMY47qyoWzaTtIRdS5sDft0b5KD2aCOO2Gsm16dAHj X-Received: by 2002:a17:906:2f15:: with SMTP id v21mr17642368eji.444.1631008453288; Tue, 07 Sep 2021 02:54:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631008453; cv=none; d=google.com; s=arc-20160816; b=CX2uZchHaVLuKMFV3Oq4nIY4s2OVU8tSAdhv7qdih69I5QRGisp/yd53110vDOFzxn ZmvvrefVape+C0SIrvHJZ+pmv71yMasDeHvn15uzHYjyl3lClhYRmHpzwgpc59v8uxLh bGh7LW9D6Qm7z0eZfCRyR3LxOZRd8KdHmGY++7t1/tV5aY4ayHsM/xeXEPSN45AHLYM2 /74gkrQKQBDcaSznIiLxPGDoAr6zar2f0X6bhk6IjulLorM6uTtAScdXzO9DqZ98o3zu s9Y7P6FasMcTpr55D8S5/sO4TElY32NHhBsIDQ35VPwlSeGWEFeYUSeL8pDC5pY7SZGD WN/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:to:from; bh=G+ZuqrgTJ9X9kvW42f8pg0zH3pJ+i1gYcm08sgS9PJ4=; b=bKpok27WvW8HalWkKAd7C6GQqLVkrkIodoUPopQVsaxm+ZNqbL0j5RoqAZmT0U7LyB FJVgJVdM0iy/kEmxDATJYbkDRIyjE/SvvfEOgrIQABe3yeguWwsgRI+f7fhOwkTpMVMl ZcFTB/MgyIyUvm5x7SZk7jUVY1Ge76jfWFlZMlORjPLDKt4NQ8/gQKEo3ROqb95A/1iY 47maNVVI5b68ad0DUdUC8dARoEIP2Y+Ggbe8TYolIccpkMt26KT8nqwz0URB4C4w9WlN qwED2diDa7PwbbCjuSkM87z9bLBomCf1rm7jcIqiOKMhrXy/YSD9taYnR24YuzajyOkU SpLA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f6si9749115ejl.695.2021.09.07.02.53.50; Tue, 07 Sep 2021 02:54:13 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233163AbhIGJfI (ORCPT + 99 others); Tue, 7 Sep 2021 05:35:08 -0400 Received: from inva020.nxp.com ([92.121.34.13]:48172 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233059AbhIGJfH (ORCPT ); Tue, 7 Sep 2021 05:35:07 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id B22D81A2AFA; Tue, 7 Sep 2021 11:34:00 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 7A88E1A165D; Tue, 7 Sep 2021 11:34:00 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 1DE30183AC4C; Tue, 7 Sep 2021 17:33:59 +0800 (+08) From: Shengjiu Wang To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, ckeepax@opensource.cirrus.com, kuninori.morimoto.gx@renesas.com, patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: wm8960: Fix clock configuration on slave mode Date: Tue, 7 Sep 2021 17:11:09 +0800 Message-Id: <1631005869-7308-1-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is a noise issue for 8kHz sample rate on slave mode. Compared with master mode, the difference is the DACDIV setting, after correcting the DACDIV, the noise is gone. There is no noise issue for 48kHz sample rate, because the default value of DACDIV is correct for 48kHz. So wm8960_configure_clocking() should be functional for ADC and DAC function even if it is slave mode. In order to be compatible for old use case, just add condition for checking that sysclk is zero with slave mode. Fixes: 0e50b51aa22f ("ASoC: wm8960: Let wm8960 driver configure its bit clock and frame clock") Signed-off-by: Shengjiu Wang --- sound/soc/codecs/wm8960.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c index 9e621a254392..9c6af76a60fd 100644 --- a/sound/soc/codecs/wm8960.c +++ b/sound/soc/codecs/wm8960.c @@ -742,7 +742,7 @@ static int wm8960_configure_clocking(struct snd_soc_component *component) int i, j, k; int ret; - if (!(iface1 & (1<<6))) { + if (!(iface1 & (1 << 6)) && !wm8960->sysclk) { dev_dbg(component->dev, "Codec is slave mode, no need to configure clock\n"); return 0; -- 2.17.1