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>
This commit is contained in:
Pengpeng Hou 2026-07-04 15:45:50 +08:00 committed by Mark Brown
parent e857b163c8
commit abe8ddff80
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -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;