Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4612493iob; Sun, 8 May 2022 19:12:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXaoEavr+VIfPewd50hTi72iZ9tylYAT6U6QX6U2WXm4x7vOKBGScNoSi4CKmRNADVW7YK X-Received: by 2002:a17:902:c404:b0:15e:9aa2:3abc with SMTP id k4-20020a170902c40400b0015e9aa23abcmr14044121plk.172.1652062354914; Sun, 08 May 2022 19:12:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652062354; cv=none; d=google.com; s=arc-20160816; b=o1sGXiBpFGh3JtoVv/97j4nCXoR06Fd577P5vBUzuHCoN/Ax6zfiWrPhoP8hebUAZW f/OphUOrgPqCTjBOxyJfLOhJVKhQSMBSRFt/yQNKOuhnDhKDSDLgzAd6YSYnPUjhY97u yTNcJztcMP0aghaYpHz2ZxQATv9xtHDMNgNxXpxx9KVc6rWBdBeml2zNlZstgTXmD7qv qoexM+Y9x642Bhd6cQbZc+tRMSh4dIHm2ttyRJ1zB/k1z/9hitOzUywv6i+GWsatWt/B DkWdegRHur5x4eWPjWgI87AOD0qaJ8dXqHOY/VfTw25TFHln/Ru5G+ZgxJxg2TNgF5/D 0myQ== 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:cc:to:from; bh=6/juB2hSCLnCGxiY/dlriNBJOYl73jwemwZy+mpCBjY=; b=x9AJJ5QN7HDKR8i7UYWi3rQpUyQUnMrVpErn5dPmhso425O6FcpOXT8sozTASh+oDT Sfpfub1cgn7P+luPFs9doaTeX7gKfet65tH+kvnVn5JNc4bTx8EcSNewEgou60+AFL2j XyVYyYBRGDx9B6QCAkUm//sLjC6Sn+NUY9INtYFyJcQt9w5B0TjTyfOpXdOa/GJ+gmt0 Xs1l3DyuVydwffzMe2B3HpQt0BhB2MHzPIcjQaSoUZx3icZ6geDhv6+rCJlMBHRggvJr CA51tCsLRxgHxql8Zu0zT0bZO2xMgB61urO0pxDwX6e3pvsmYhZj9VlikYRRV+50gaHl yxOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id iy13-20020a17090b16cd00b001cd658e7640si17229078pjb.43.2022.05.08.19.12.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 19:12:34 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A6E674EF42; Sun, 8 May 2022 19:12:31 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235109AbiEGMaJ (ORCPT + 99 others); Sat, 7 May 2022 08:30:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232303AbiEGMaH (ORCPT ); Sat, 7 May 2022 08:30:07 -0400 Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 932323AA67 for ; Sat, 7 May 2022 05:26:19 -0700 (PDT) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id D3639200284; Sat, 7 May 2022 14:26:17 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 9C55D2007C8; Sat, 7 May 2022 14:26:17 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 2096D180031B; Sat, 7 May 2022 20:26:16 +0800 (+08) From: Shengjiu Wang To: nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, shengjiu.wang@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] ASoc: fsl_micfil: explicitly clear software reset bit Date: Sat, 7 May 2022 20:14:13 +0800 Message-Id: <1651925654-32060-1-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SRES is self-cleared bit, but REG_MICFIL_CTRL1 is defined as non volatile register, it still remain in regmap cache after set, then every update of REG_MICFIL_CTRL1, software reset happens. to avoid this, clear it explicitly. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_micfil.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sound/soc/fsl/fsl_micfil.c b/sound/soc/fsl/fsl_micfil.c index cd85c8714f97..2149fac0dcc6 100644 --- a/sound/soc/fsl/fsl_micfil.c +++ b/sound/soc/fsl/fsl_micfil.c @@ -179,6 +179,17 @@ static int fsl_micfil_reset(struct device *dev) if (ret) return ret; + /* + * SRES is self-cleared bit, but REG_MICFIL_CTRL1 is defined + * as non-volatile register, so SRES still remain in regmap + * cache after set, that every update of REG_MICFIL_CTRL1, + * software reset happens. so clear it explicitly. + */ + ret = regmap_clear_bits(micfil->regmap, REG_MICFIL_CTRL1, + MICFIL_CTRL1_SRES); + if (ret) + return ret; + return 0; } -- 2.17.1