From ee5f3c03ef113dbd8cba0a3c6c895ef3ed9f149f Mon Sep 17 00:00:00 2001 From: Sugar Zhang Date: Thu, 12 Nov 2020 09:30:12 +0800 Subject: [PATCH] ASoC: codecs: rk_codec_digital: Restore register when pm runtime_suspend/resume Change-Id: I0730f50faa3fea1823570dd7390ac760efbfe99f Signed-off-by: Sugar Zhang --- sound/soc/codecs/rk_codec_digital.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sound/soc/codecs/rk_codec_digital.c b/sound/soc/codecs/rk_codec_digital.c index f900155ba32d..c500f3a3a5ce 100644 --- a/sound/soc/codecs/rk_codec_digital.c +++ b/sound/soc/codecs/rk_codec_digital.c @@ -602,6 +602,13 @@ static int rk_codec_digital_runtime_resume(struct device *dev) if (ret) return ret; + regcache_cache_only(rcd->regmap, false); + regcache_mark_dirty(rcd->regmap); + + ret = regcache_sync(rcd->regmap); + if (ret) + goto err; + ret = clk_prepare_enable(rcd->clk_adc); if (ret) goto err; @@ -630,6 +637,7 @@ static int rk_codec_digital_runtime_suspend(struct device *dev) { struct rk_codec_digital_priv *rcd = dev_get_drvdata(dev); + regcache_cache_only(rcd->regmap, true); clk_disable_unprepare(rcd->clk_adc); clk_disable_unprepare(rcd->clk_dac); clk_disable_unprepare(rcd->clk_i2c);