ASoC: sgtl5000: Reset the CHIP_CLK_CTRL reg on remove
authorDetlev Casanova <detlev.casanova@collabora.com>
Thu, 10 Nov 2022 19:06:12 +0000 (14:06 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Dec 2022 16:39:59 +0000 (17:39 +0100)
commit4f6c7344ab261999847baa78688f55a45875e7b9
treeb7306c2bc729fb62e51152d7b562535d4e5234b5
parent164a5b50d10488d4b442453aaf71a78fa36e6fb4
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>
sound/soc/codecs/sgtl5000.c