alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: rt1015: re-calibrate again when resuming
@ 2020-12-25  3:08 Tzung-Bi Shih
  2021-01-05 16:06 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Tzung-Bi Shih @ 2020-12-25  3:08 UTC (permalink / raw)
  To: broonie; +Cc: tzungbi, alsa-devel

Assuming the calibration state gets lost after system suspend.
Re-calibrates again when resuming.

The rt1015_priv is alloced by kzalloc.  No need to initialize cali_done
to 0 in component probe callback.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
---
The idea is inspired from previous discussion:
https://mailman.alsa-project.org/pipermail/alsa-devel/2020-December/178229.html

The patch applies after the series:
https://mailman.alsa-project.org/pipermail/alsa-devel/2020-December/178608.html

v1 attempt:
https://mailman.alsa-project.org/pipermail/alsa-devel/2020-December/178614.html

 sound/soc/codecs/rt1015.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/rt1015.c b/sound/soc/codecs/rt1015.c
index 4a9e2eaebe30..3b06eaddccaf 100644
--- a/sound/soc/codecs/rt1015.c
+++ b/sound/soc/codecs/rt1015.c
@@ -1055,7 +1055,6 @@ static int rt1015_probe(struct snd_soc_component *component)
 
 	rt1015->component = component;
 	rt1015->bclk_ratio = 0;
-	rt1015->cali_done = 0;
 
 	INIT_DELAYED_WORK(&rt1015->flush_work, rt1015_flush_work);
 
@@ -1113,6 +1112,10 @@ static int rt1015_resume(struct snd_soc_component *component)
 
 	regcache_cache_only(rt1015->regmap, false);
 	regcache_sync(rt1015->regmap);
+
+	if (rt1015->cali_done)
+		rt1015_calibrate(rt1015);
+
 	return 0;
 }
 #else
-- 
2.29.2.729.g45daf8777d-goog


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

* Re: [PATCH] ASoC: rt1015: re-calibrate again when resuming
  2020-12-25  3:08 [PATCH] ASoC: rt1015: re-calibrate again when resuming Tzung-Bi Shih
@ 2021-01-05 16:06 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2021-01-05 16:06 UTC (permalink / raw)
  To: Tzung-Bi Shih; +Cc: alsa-devel

On Fri, 25 Dec 2020 11:08:45 +0800, Tzung-Bi Shih wrote:
> Assuming the calibration state gets lost after system suspend.
> Re-calibrates again when resuming.
> 
> The rt1015_priv is alloced by kzalloc.  No need to initialize cali_done
> to 0 in component probe callback.

Applied to

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

Thanks!

[1/1] ASoC: rt1015: re-calibrate again when resuming
      commit: d750570e048165c54a99703729438b2a4ccf379b

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] 2+ messages in thread

end of thread, other threads:[~2021-01-05 16:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-25  3:08 [PATCH] ASoC: rt1015: re-calibrate again when resuming Tzung-Bi Shih
2021-01-05 16:06 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).