summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbui duc phuc <phucduc.bui@gmail.com>2026-09-03 12:11:49 +0700
committerMark Brown <broonie@kernel.org>2026-09-08 15:12:36 +0100
commit0830625cacf94ae66f68b4e9d2e926a152a90dca (patch)
tree0c26f9b150b4a8635804104adc3a73b6e994d529
parentd87989ec1c2a65646bcf6c8aaea46836b93e12ea (diff)
downloadlinux-next-0830625cacf94ae66f68b4e9d2e926a152a90dca.tar.gz
linux-next-0830625cacf94ae66f68b4e9d2e926a152a90dca.zip
ASoC: mediatek: mt8186: Handle regcache sync failure
Check the return value of regcache_sync() and restore cache-only mode if synchronization fails. Signed-off-by: bui duc phuc <phucduc.bui@gmail.com> Link: https://patch.msgid.link/20260903051150.178057-8-phucduc.bui@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/mediatek/mt8186/mt8186-afe-pcm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/soc/mediatek/mt8186/mt8186-afe-pcm.c b/sound/soc/mediatek/mt8186/mt8186-afe-pcm.c
index 44a521c3a610..143386c54dd7 100644
--- a/sound/soc/mediatek/mt8186/mt8186-afe-pcm.c
+++ b/sound/soc/mediatek/mt8186/mt8186-afe-pcm.c
@@ -2743,7 +2743,11 @@ static int mt8186_afe_runtime_resume(struct device *dev)
goto skip_regmap;
regcache_cache_only(afe->regmap, false);
- regcache_sync(afe->regmap);
+ ret = regcache_sync(afe->regmap);
+ if (ret) {
+ regcache_cache_only(afe->regmap, true);
+ return ret;
+ }
/* enable audio sys DCM for power saving */
regmap_update_bits(afe_priv->infracfg, PERI_BUS_DCM_CTRL, BIT(29), BIT(29));