From a33052cd79a9828dc0037784848685ab6a67057a Mon Sep 17 00:00:00 2001 From: Shunhua Lan Date: Fri, 7 Jan 2022 12:51:52 +0800 Subject: [PATCH] ASoC: es8323: cache sync registers when doing suspend/resume Signed-off-by: Shunhua Lan Change-Id: I88df09eb772fe2d59dc531974859a9b2a081bcbd --- sound/soc/codecs/es8323.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sound/soc/codecs/es8323.c b/sound/soc/codecs/es8323.c index 523c6320300d..4fc6bc5d5ed7 100644 --- a/sound/soc/codecs/es8323.c +++ b/sound/soc/codecs/es8323.c @@ -703,6 +703,8 @@ static struct snd_soc_dai_driver es8323_dai = { static int es8323_suspend(struct snd_soc_component *component) { + struct es8323_priv *es8323 = snd_soc_component_get_drvdata(component); + snd_soc_component_write(component, 0x19, 0x06); snd_soc_component_write(component, 0x30, 0x00); snd_soc_component_write(component, 0x31, 0x00); @@ -713,11 +715,17 @@ static int es8323_suspend(struct snd_soc_component *component) snd_soc_component_write(component, 0x01, 0x58); snd_soc_component_write(component, 0x2b, 0x9c); usleep_range(18000, 20000); + regcache_cache_only(es8323->regmap, true); + regcache_mark_dirty(es8323->regmap); return 0; } static int es8323_resume(struct snd_soc_component *component) { + struct es8323_priv *es8323 = snd_soc_component_get_drvdata(component); + + regcache_cache_only(es8323->regmap, false); + snd_soc_component_cache_sync(component); snd_soc_component_write(component, 0x2b, 0x80); snd_soc_component_write(component, 0x01, 0x50); snd_soc_component_write(component, 0x00, 0x32);