summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorDetlev Casanova <detlev.casanova@collabora.com>2022-11-10 14:06:12 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-12-08 11:18:29 +0100
commit2cb48754c2d62ebff88e050c93eb0d161a41e63c (patch)
treec31d69e2b582fbf92b845ede9ad375d959cd5a07 /sound
parentace257da35d18d9d684a8f85f4b3c10a41493663 (diff)
downloadlinux-stable-2cb48754c2d62ebff88e050c93eb0d161a41e63c.tar.gz
linux-stable-2cb48754c2d62ebff88e050c93eb0d161a41e63c.tar.bz2
linux-stable-2cb48754c2d62ebff88e050c93eb0d161a41e63c.zip
ASoC: sgtl5000: Reset the CHIP_CLK_CTRL reg on remove
[ Upstream commit 0bb8e9b36b5b7f2e77892981ff6c27ee831d8026 ] Since commit bf2aebccddef ("ASoC: sgtl5000: Fix noise on shutdown/remove"), the device power control registers are reset when the driver is removed/shutdown. This is an issue when the device is configured to use the PLL clock. The device will stop responding if it is still configured to use the PLL clock but the PLL clock is powered down. When rebooting linux, the probe function will show: sgtl5000 0-000a: Error reading chip id -11 Make sure that the CHIP_CLK_CTRL is reset to its default value before powering down the device. Fixes: bf2aebccddef ("ASoC: sgtl5000: Fix noise on shutdown/remove") Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com> Reviewed-by: Fabio Estevam <festevam@gmail.com> Link: https://lore.kernel.org/r/20221110190612.1341469-1-detlev.casanova@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/sgtl5000.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index 13e752f8b3f7..0708b5019910 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -1769,6 +1769,7 @@ static int sgtl5000_i2c_remove(struct i2c_client *client)
{
struct sgtl5000_priv *sgtl5000 = i2c_get_clientdata(client);
+ regmap_write(sgtl5000->regmap, SGTL5000_CHIP_CLK_CTRL, SGTL5000_CHIP_CLK_CTRL_DEFAULT);
regmap_write(sgtl5000->regmap, SGTL5000_CHIP_DIG_POWER, SGTL5000_DIG_POWER_DEFAULT);
regmap_write(sgtl5000->regmap, SGTL5000_CHIP_ANA_POWER, SGTL5000_ANA_POWER_DEFAULT);