mirror of
https://github.com/torvalds/linux.git
synced 2026-09-27 11:02:03 +02:00
ASoC: codecs: rt9120: Propagate regcache_sync() errors
regcache_sync() can fail while replaying cached register state after runtime resume. rt9120_runtime_resume() currently ignores that failure and returns success. Propagate the error, restore cache-only/dirty state, and power the device back down on sync failure. Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn> Link: https://patch.msgid.link/20260704035548.67713-1-pengpeng@iscas.ac.cn Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
2c5e237e7e
commit
aeb606a643
|
|
@ -606,12 +606,19 @@ static int rt9120_runtime_suspend(struct device *dev)
|
|||
static int rt9120_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct rt9120_data *data = dev_get_drvdata(dev);
|
||||
int ret;
|
||||
|
||||
if (data->pwdnn_gpio) {
|
||||
gpiod_set_value(data->pwdnn_gpio, 1);
|
||||
msleep(RT9120_CHIPON_WAITMS);
|
||||
regcache_cache_only(data->regmap, false);
|
||||
regcache_sync(data->regmap);
|
||||
ret = regcache_sync(data->regmap);
|
||||
if (ret) {
|
||||
regcache_cache_only(data->regmap, true);
|
||||
regcache_mark_dirty(data->regmap);
|
||||
gpiod_set_value(data->pwdnn_gpio, 0);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user