]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
ASoC: wm8904: fix regcache handling
authorMichael Walle <michael@walle.cc>
Tue, 12 Nov 2019 22:36:29 +0000 (23:36 +0100)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 29 Jan 2020 05:00:31 +0000 (00:00 -0500)
BugLink: https://bugs.launchpad.net/bugs/1860490
[ 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 <michael@walle.cc>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20191112223629.21867-1-michael@walle.cc
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
sound/soc/codecs/wm8904.c

index 5ebdd1d9afdeab2ccb038c989794dbbdee49301f..036b5c214320d22b9c02ab2a544552fbc9273365 100644 (file)
@@ -1903,6 +1903,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);