mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: sgtl5000: Reset the CHIP_CLK_CTRL reg on remove
@ 2022-11-10 19:06 Detlev Casanova
  2022-11-10 19:08 ` Fabio Estevam
  2022-11-10 20:38 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Detlev Casanova @ 2022-11-10 19:06 UTC (permalink / raw)
  To: linux-kernel
  Cc: Fabio Estevam, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, moderated list:NXP SGTL5000 DRIVER,
	Detlev Casanova

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>
---
 sound/soc/codecs/sgtl5000.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index 4b2135eba74d..a916f4619ea3 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -1794,6 +1794,7 @@ static void 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);
 
-- 
2.38.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: sgtl5000: Reset the CHIP_CLK_CTRL reg on remove
  2022-11-10 19:06 [PATCH] ASoC: sgtl5000: Reset the CHIP_CLK_CTRL reg on remove Detlev Casanova
@ 2022-11-10 19:08 ` Fabio Estevam
  2022-11-10 20:38 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Fabio Estevam @ 2022-11-10 19:08 UTC (permalink / raw)
  To: Detlev Casanova
  Cc: linux-kernel, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, moderated list:NXP SGTL5000 DRIVER

On Thu, Nov 10, 2022 at 4:06 PM Detlev Casanova
<detlev.casanova@collabora.com> wrote:
>
> 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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: sgtl5000: Reset the CHIP_CLK_CTRL reg on remove
  2022-11-10 19:06 [PATCH] ASoC: sgtl5000: Reset the CHIP_CLK_CTRL reg on remove Detlev Casanova
  2022-11-10 19:08 ` Fabio Estevam
@ 2022-11-10 20:38 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2022-11-10 20:38 UTC (permalink / raw)
  To: Detlev Casanova, linux-kernel
  Cc: Jaroslav Kysela, moderated list:NXP SGTL5000 DRIVER,
	Liam Girdwood, Takashi Iwai, Fabio Estevam

On Thu, 10 Nov 2022 14:06:12 -0500, Detlev Casanova wrote:
> 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.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: sgtl5000: Reset the CHIP_CLK_CTRL reg on remove
      commit: 0bb8e9b36b5b7f2e77892981ff6c27ee831d8026

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-10 20:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-10 19:06 [PATCH] ASoC: sgtl5000: Reset the CHIP_CLK_CTRL reg on remove Detlev Casanova
2022-11-10 19:08 ` Fabio Estevam
2022-11-10 20:38 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®