All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: tas2770: Reinit regcache on reset
@ 2022-09-19 17:34 ` Martin Povišer
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Povišer @ 2022-09-19 17:34 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown
  Cc: navada, Charles Keepax, Stephen Kitt, Dan Murphy, alsa-devel,
	linux-kernel, Martin Povišer

On probe of the ASoC component, the device is reset but the regcache is
retained. This means the regcache gets out of sync if the codec is
rebound to a sound card for a second time. Fix it by reinitializing the
regcache to defaults after the device is reset.

Fixes: b0bcbe615756 ("ASoC: tas2770: Fix calling reset in probe")
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
---
 sound/soc/codecs/tas2770.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sound/soc/codecs/tas2770.c b/sound/soc/codecs/tas2770.c
index bb653b664146..b6765235a4b3 100644
--- a/sound/soc/codecs/tas2770.c
+++ b/sound/soc/codecs/tas2770.c
@@ -495,6 +495,8 @@ static struct snd_soc_dai_driver tas2770_dai_driver[] = {
 	},
 };
 
+static const struct regmap_config tas2770_i2c_regmap;
+
 static int tas2770_codec_probe(struct snd_soc_component *component)
 {
 	struct tas2770_priv *tas2770 =
@@ -508,6 +510,7 @@ static int tas2770_codec_probe(struct snd_soc_component *component)
 	}
 
 	tas2770_reset(tas2770);
+	regmap_reinit_cache(tas2770->regmap, &tas2770_i2c_regmap);
 
 	return 0;
 }
-- 
2.33.0


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

* [PATCH] ASoC: tas2770: Reinit regcache on reset
@ 2022-09-19 17:34 ` Martin Povišer
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Povišer @ 2022-09-19 17:34 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown
  Cc: alsa-devel, Stephen Kitt, linux-kernel, navada, Dan Murphy,
	Martin Povišer, Charles Keepax

On probe of the ASoC component, the device is reset but the regcache is
retained. This means the regcache gets out of sync if the codec is
rebound to a sound card for a second time. Fix it by reinitializing the
regcache to defaults after the device is reset.

Fixes: b0bcbe615756 ("ASoC: tas2770: Fix calling reset in probe")
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
---
 sound/soc/codecs/tas2770.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sound/soc/codecs/tas2770.c b/sound/soc/codecs/tas2770.c
index bb653b664146..b6765235a4b3 100644
--- a/sound/soc/codecs/tas2770.c
+++ b/sound/soc/codecs/tas2770.c
@@ -495,6 +495,8 @@ static struct snd_soc_dai_driver tas2770_dai_driver[] = {
 	},
 };
 
+static const struct regmap_config tas2770_i2c_regmap;
+
 static int tas2770_codec_probe(struct snd_soc_component *component)
 {
 	struct tas2770_priv *tas2770 =
@@ -508,6 +510,7 @@ static int tas2770_codec_probe(struct snd_soc_component *component)
 	}
 
 	tas2770_reset(tas2770);
+	regmap_reinit_cache(tas2770->regmap, &tas2770_i2c_regmap);
 
 	return 0;
 }
-- 
2.33.0


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

* Re: [PATCH] ASoC: tas2770: Reinit regcache on reset
  2022-09-19 17:34 ` Martin Povišer
  (?)
@ 2022-09-19 23:09 ` Mark Brown
  -1 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2022-09-19 23:09 UTC (permalink / raw)
  To: Martin Povišer, Liam Girdwood
  Cc: alsa-devel, Charles Keepax, linux-kernel, navada, Dan Murphy,
	Stephen Kitt

On Mon, 19 Sep 2022 19:34:53 +0200, Martin Povišer wrote:
> On probe of the ASoC component, the device is reset but the regcache is
> retained. This means the regcache gets out of sync if the codec is
> rebound to a sound card for a second time. Fix it by reinitializing the
> regcache to defaults after the device is reset.
> 
> 

Applied to

   broonie/sound.git for-linus

Thanks!

[1/1] ASoC: tas2770: Reinit regcache on reset
      commit: 0a0342ede303fc420f3a388e1ae82da3ae8ff6bd

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-09-19 23:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-19 17:34 [PATCH] ASoC: tas2770: Reinit regcache on reset Martin Povišer
2022-09-19 17:34 ` Martin Povišer
2022-09-19 23:09 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.