summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPengpeng Hou <pengpeng@iscas.ac.cn>2026-07-04 15:45:50 +0800
committerMark Brown <broonie@kernel.org>2026-07-09 17:16:19 +0100
commitabe8ddff80fdfce5255ab9f5931aaed5b058bb65 (patch)
tree306e93e14d8983224124f0ec4a4126573d019bd9
parente857b163c8f441d477db36f0aca1cf6e258a4be7 (diff)
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 <pengpeng@iscas.ac.cn> Link: https://patch.msgid.link/20260704074550.57755-1-pengpeng@iscas.ac.cn Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/rt5514.c16
1 files 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;