Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2326029pxb; Tue, 12 Oct 2021 04:21:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBz28+JWCIkIXlkimay1jmKRktyaSgzozzG9FDRo5umOG/B3/7SifCkWLfw+bX99bWyOqw X-Received: by 2002:a17:90a:d996:: with SMTP id d22mr2732291pjv.20.1634037716745; Tue, 12 Oct 2021 04:21:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634037716; cv=none; d=google.com; s=arc-20160816; b=QV8wEobz+L9TjnsmezYXbzHEIFdwdSAsvBi2kg40jiI2q5bMSsEaEbJQZewK3+aWop /ZZpi9s7sOEGd5w8nwfVbdBkV9VLOQbdimzmll4rTUpiflVyJlyYjwzg8O/6Q+3I1CDu vsfo6j+9rzkus/RWufjgkv/Pikt48wxqW815c+IaeJed1jYzDxoBUv6uXBl9eXTB44VU gbZa+VruLiiCmWdE8fo8KqpkhgifjTyXdJpWeH/F4Gk5OWgNeuIAqLSuH79bpFfV86Fq 2u6ynvjIi5WLUv4u3/Rf8KJS2v5GKGuC3sAI5eb717U33xQagbu1EY7FlCf10c++UQR+ X6qA== 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=Iuu/YCoXCgCLbIKjV4RMqsUbPkgLpl3aiYb/BxYswaAf03KMVEBlO9fQXu/+s85E/e s8qZfXpmbJednD69qbN/lvg29Bxw79N5Sgqp3Ifnzj2XlNFCm0OOiaJQFbGq4XqVl47x uIG+TxEQZG+Ja78/S7S5noZjVL361qB8tmSRfT3XeI3ifmN2t/aC+KIKzS6npNXkehxt gk/p4DD7M4VqMZypLg33rlzUAWqttqBUvSpinlZ2Be628io7JZxr5gf0KzL3cjrLii5r 5XUsSx/LS1b+qLDSSMmZL60tfduFcazNSQIl7DO61Rw3OjzmXkKBIUc9UFUdmgpQ0R2H fSWA== 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 k12si2854542pjg.57.2021.10.12.04.21.42; Tue, 12 Oct 2021 04:21:56 -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 S236123AbhJLLVc (ORCPT + 99 others); Tue, 12 Oct 2021 07:21:32 -0400 Received: from inva020.nxp.com ([92.121.34.13]:38688 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236088AbhJLLVc (ORCPT ); Tue, 12 Oct 2021 07:21:32 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 188AA1A1D75; Tue, 12 Oct 2021 13:19:29 +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 D4EFB1A1503; Tue, 12 Oct 2021 13:19:28 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 785E8183AC8B; Tue, 12 Oct 2021 19:19:27 +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: [RESEND PATCH] ASoC: wm8960: Fix clock configuration on slave mode Date: Tue, 12 Oct 2021 18:54:30 +0800 Message-Id: <1634036070-2671-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