From e857b163c8f441d477db36f0aca1cf6e258a4be7 Mon Sep 17 00:00:00 2001 From: Pengpeng Hou Date: Sat, 4 Jul 2026 15:44:34 +0800 Subject: [PATCH] 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 Link: https://patch.msgid.link/20260704074434.54200-1-pengpeng@iscas.ac.cn Signed-off-by: Mark Brown --- sound/soc/codecs/wsa881x.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c index 5174614c3e83..47ac3e4985a5 100644 --- a/sound/soc/codecs/wsa881x.c +++ b/sound/soc/codecs/wsa881x.c @@ -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; }