Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13475147ybl; Sun, 29 Dec 2019 12:48:15 -0800 (PST) X-Google-Smtp-Source: APXvYqxlRHfDI022HUy+hnIC2NQIoj/xgcTVzbwJIqWm7W1rJpHVJJDSxSTXhVQXcKcmDKW9HOLj X-Received: by 2002:a9d:4706:: with SMTP id a6mr65343949otf.331.1577652495133; Sun, 29 Dec 2019 12:48:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577652495; cv=none; d=google.com; s=arc-20160816; b=wwWUNdaTejOR4JvWYDE/3vCZqk6u0QpzQ2R1+jvifYN4l1U7lAbmju8CWpy1N4gVkB lVn9k6SfRkfzW4CpcFlTCLeXCbMzgAU0Kb9Z89ZzpfgLPS6yUZSuGGD3Pm+5sbjJWnba nMlBSYhri7IhZ0BqY4i6pgY/vA03wKWV/oknrKR3SzOY36btziEbQ2zk7EH+APbl9Rui F3cTEhobA1IFOnYt0Aku270Mn5R8xP25y8SIzHyFLJ5jYWpLsuoPxS3ysQaujXBr5q8K p8LE9abqwiQtqDDQnMrAeAyPjgqy6rrbXZeUpxWKK4HfJ+hZ9PBufBDPsCguOG7KVJ+I KoRQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hwXuWr5uZK78ac4ZUKnfWqadDmUm4/ya2jvmDilWmLI=; b=f5zI4WkoGdVfad0MPgCiXOt3txaNqJ+zHa9kXYO8ndGnvVNXiFq11jEUF9N+PtFBgv HLjJpTYRyrlHKvb3mphw+15MJUPlnwMa93rOcEMmz0BSBlj3haO/Jhz3+fodgDL0aK6x oPzTGAfEybNoRY2O2N5LsBFtN2W8jtIO/oybAa30xs0w23JiKWe/1uJpi5MCf6Yx4T1Q PFNc6BbO7cVSOBDkZ36tLrB6HHVLksSSuSvV7juRyIsXtatlK4+cBnaMRc8GdyZTshlu LM1itJqn3lHZ22zteCSorqJIu4VLsj9TgkdmPjcz8RDGKmgOPvFR+N3DTvk5nRKM31gq kzzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="0VPrAL/c"; 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 a10si6178125oid.84.2019.12.29.12.48.04; Sun, 29 Dec 2019 12:48:15 -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=@kernel.org header.s=default header.b="0VPrAL/c"; 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 S1732548AbfL2Rxt (ORCPT + 99 others); Sun, 29 Dec 2019 12:53:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:40980 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732538AbfL2Rxr (ORCPT ); Sun, 29 Dec 2019 12:53:47 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1F605206A4; Sun, 29 Dec 2019 17:53:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577642026; bh=7BlVCiFDwC0vCLjXpAHO61C5t/zW6H3A3ibe++xP7gA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0VPrAL/cjW61tYF6JDGO1OVkUtXJ8wlaIYXID0f7JYap2w/QDLg71LuTY59YzU03Z SG7fzCDnGDRX/kwiK+vyUWxaU/QnHGXBnjEWKWBnV+plokSt+DA46vanCbmR5/3x5L tQrr9ontw2XCA9EMX2oXBjXwP+l/aFod+27sGA1A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Walle , Charles Keepax , Mark Brown , Sasha Levin Subject: [PATCH 5.4 310/434] ASoC: wm8904: fix regcache handling Date: Sun, 29 Dec 2019 18:26:03 +0100 Message-Id: <20191229172722.544935314@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michael Walle [ Upstream commit e9149b8c00d25dbaef1aa174fc604bed207e576d ] 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 Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20191112223629.21867-1-michael@walle.cc Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- 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 bcb3c9d5abf0..9e8c564f6e9c 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c @@ -1917,6 +1917,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