ASoC: sgtl5000: Fix noise on shutdown/remove
authorFrancesco Dolcini <francesco.dolcini@toradex.com>
Fri, 24 Jun 2022 10:13:01 +0000 (12:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Jul 2022 19:24:18 +0000 (21:24 +0200)
commit9b9773cc55d8f35be574c6f7d912a3d28522be07
treebd96bcffd183cbc7d1e0b3981ccaf31379bf970c
parentc8d5d81940938b5f6c0f495ca9538e7740416f30
ASoC: sgtl5000: Fix noise on shutdown/remove

[ Upstream commit 040e3360af3736348112d29425bf5d0be5b93115 ]

Put the SGTL5000 in a silent/safe state on shutdown/remove, this is
required since the SGTL5000 produces a constant noise on its output
after it is configured and its clock is removed. Without this change
this is happening every time the module is unbound/removed or from
reboot till the clock is enabled again.

The issue was experienced on both a Toradex Colibri/Apalis iMX6, but can
be easily reproduced everywhere just playing something on the codec and
after that removing/unbinding the driver.

Fixes: 9b34e6cc3bc2 ("ASoC: Add Freescale SGTL5000 codec support")
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Link: https://lore.kernel.org/r/20220624101301.441314-1-francesco.dolcini@toradex.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/codecs/sgtl5000.c
sound/soc/codecs/sgtl5000.h