From d750570e048165c54a99703729438b2a4ccf379b Mon Sep 17 00:00:00 2001 From: Tzung-Bi Shih Date: Fri, 25 Dec 2020 11:08:45 +0800 Subject: ASoC: rt1015: re-calibrate again when resuming 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 Link: https://lore.kernel.org/r/20201225030845.4138497-1-tzungbi@google.com Signed-off-by: Mark Brown --- sound/soc/codecs/rt1015.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sound/soc/codecs/rt1015.c') diff --git a/sound/soc/codecs/rt1015.c b/sound/soc/codecs/rt1015.c index bf452cc0096f..145724a5f389 100644 --- a/sound/soc/codecs/rt1015.c +++ b/sound/soc/codecs/rt1015.c @@ -1035,7 +1035,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); @@ -1093,6 +1092,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 -- cgit v1.2.3