From abe8ddff80fdfce5255ab9f5931aaed5b058bb65 Mon Sep 17 00:00:00 2001 From: Pengpeng Hou Date: Sat, 4 Jul 2026 15:45:50 +0800 Subject: [PATCH] ASoC: codecs: rt5514: Propagate bias restore errors rt5514_set_bias_level() restores normal recording settings when leaving the DSP-enabled state, but ignores both the patch write and regcache_sync() failures. The bias transition can therefore report success even when the restore did not complete. Propagate the write and sync errors from the bias-level restore path. Only clear dsp_enabled after both restore operations succeed, so a failed restore keeps the internal state retryable. Signed-off-by: Pengpeng Hou Link: https://patch.msgid.link/20260704074550.57755-1-pengpeng@iscas.ac.cn Signed-off-by: Mark Brown --- sound/soc/codecs/rt5514.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/rt5514.c b/sound/soc/codecs/rt5514.c index 00a4a208d2fa..58aecd4c83a6 100644 --- a/sound/soc/codecs/rt5514.c +++ b/sound/soc/codecs/rt5514.c @@ -1073,12 +1073,18 @@ static int rt5514_set_bias_level(struct snd_soc_component *component, * settings to make sure recording properly. */ if (rt5514->dsp_enabled) { - rt5514->dsp_enabled = 0; - regmap_multi_reg_write(rt5514->i2c_regmap, - rt5514_i2c_patch, - ARRAY_SIZE(rt5514_i2c_patch)); + ret = regmap_multi_reg_write(rt5514->i2c_regmap, + rt5514_i2c_patch, + ARRAY_SIZE(rt5514_i2c_patch)); + if (ret) + return ret; + regcache_mark_dirty(rt5514->regmap); - regcache_sync(rt5514->regmap); + ret = regcache_sync(rt5514->regmap); + if (ret) + return ret; + + rt5514->dsp_enabled = 0; } } break;