ASoC: codecs: wsa881x: Propagate regcache_sync() errors

wsa881x_runtime_resume() powers the device up, waits for SoundWire
initialization, leaves cache-only mode, and replays cached register
state. It currently ignores regcache_sync() failures and returns
success.

Propagate sync failures, restore cache-only/dirty state, and undo the
shutdown GPIO state acquired by resume.

Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260704074434.54200-1-pengpeng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Pengpeng Hou
2026-07-09 17:11:53 +01:00
committed by Mark Brown
parent f047e6a0f9
commit e857b163c8
+7 -1
View File
@@ -1178,7 +1178,13 @@ static int wsa881x_runtime_resume(struct device *dev)
}
regcache_cache_only(regmap, false);
regcache_sync(regmap);
ret = regcache_sync(regmap);
if (ret) {
regcache_cache_only(regmap, true);
regcache_mark_dirty(regmap);
gpiod_direction_output(wsa881x->sd_n, 1);
return ret;
}
return 0;
}