Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1116689ybc; Tue, 12 Nov 2019 14:40:59 -0800 (PST) X-Google-Smtp-Source: APXvYqy/p+EvZD4MEbk0pQ3o+60iAU20+JfFgXb+GNRdorqK5Cz76qZm02f0U+ZWXC3+mwP4rUZ2 X-Received: by 2002:a05:6402:4c5:: with SMTP id n5mr112906edw.157.1573598459404; Tue, 12 Nov 2019 14:40:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573598459; cv=none; d=google.com; s=arc-20160816; b=QAmbLKUs346sP/InH53nfg7PU/gw9bLmrBCxnx3C1NjOl51WsIDptIwWSv5WubumEY A5/5FMsAKx0nehoroVucHGl+w3yCnGgE9SWE/OO8hH4r/B8094NqDc7Z0xT7M2Qv0Isa BHybHXbJhqU2/B5XUi/RBe0VUnSN7weuZdN7H80L9k0EpEIMX+kPNEZD/fVWvARqytef sKlqV9HV/+G9xdgnYE++pc7GLVQqqDLFbSAGJHtQ1CYIN9F/zFJdSrJOFiqRgqIHt/ka sCcdYjVFfN0yDgA4pJBn/307GFKHzrL37jTbldINLkBeqf/lQOyem3IzzSJnmIQtufSv cA9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ZQCAeIvVXoosI5EZ8z5kIox93/qG64eH4vjhPLAKDEU=; b=rupxa81twtxMCeqaZYW0YfpLS7J3t6G1qv/kmD5WWuzMyTLonouSjIG2VYu4ab0K1Q C1BQJbk+eWVoUdeyRkphJHAP4B9k7ztS8ieCk4j+dHGCNRNSRI+jdR+7UId2TcsPIna1 L6ZitlsSdNlvqtIdJkfqGzqhucOXDAG6tOB9eNCuLD1uHzWbyVGd+S6HzQqt0X8GQU4/ bJ4+HgX3QlW3UEbq+Y2rsOIk4uUwNpbpV4soyB6t0uYiEAL+S/KLp3/Kz+LW3yyuUVvV gHLnmCW3xM9pSN0T1YkA8Ma1GYUe5SaPOZqy8g4eYo/PHy4poRzzIfA9uW0eX5A1FCci NcNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=iTB6fj85; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e48si15079673ede.207.2019.11.12.14.40.35; Tue, 12 Nov 2019 14:40:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=iTB6fj85; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727145AbfKLWgt (ORCPT + 99 others); Tue, 12 Nov 2019 17:36:49 -0500 Received: from ssl.serverraum.org ([176.9.125.105]:48261 "EHLO ssl.serverraum.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726932AbfKLWgt (ORCPT ); Tue, 12 Nov 2019 17:36:49 -0500 Received: from apollo.fritz.box (unknown [IPv6:2a02:810c:c200:2e91:6257:18ff:fec4:ca34]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 8E46223E5E; Tue, 12 Nov 2019 23:36:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1573598207; bh=ZQCAeIvVXoosI5EZ8z5kIox93/qG64eH4vjhPLAKDEU=; h=From:To:Cc:Subject:Date:From; b=iTB6fj85oF0ZhsoYtDOGYHj34i+UA5ro2SweiXUgFZck9fLcO3Pga1XqRnlRqStNB J4LFkgEL1XTkffZlv5EC6fHHP7Qx/uWTvbva86JOy2gJHR0WH1pi5QsgqBsiWRgtrn EWwoSs60a/xLq6h4p/W28ijJjslI882EOmIn/v5I= From: Michael Walle To: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , patches@opensource.cirrus.com, Michael Walle Subject: [PATCH] ASoC: wm8904: fix regcache handling Date: Tue, 12 Nov 2019 23:36:29 +0100 Message-Id: <20191112223629.21867-1-michael@walle.cc> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: clamav-milter 0.101.4 at web X-Virus-Status: Clean Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The current code assumes that the power is turned off in SND_SOC_BIAS_OFF. If there are no actual regulator the codec isn't turned off and the registers are not reset to their default values but the regcache is still marked as dirty. Thus a value might not be written to the hardware if it is set to the default value. Do a software reset before turning off the power to make sure the registers are always reset to their default states. Signed-off-by: Michael Walle --- sound/soc/codecs/wm8904.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index 2a7d23a5daa8..7d7ea15d73e0 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c @@ -1933,6 +1933,7 @@ static int wm8904_set_bias_level(struct snd_soc_component *component, snd_soc_component_update_bits(component, WM8904_BIAS_CONTROL_0, WM8904_BIAS_ENA, 0); + snd_soc_component_write(component, WM8904_SW_RESET_AND_ID, 0); regcache_cache_only(wm8904->regmap, true); regcache_mark_dirty(wm8904->regmap); -- 2.20.1