[PATCH] ASoC: codecs: wsa881x: Propagate regcache_sync() errors

From: Pengpeng Hou

Date: Sat Jul 04 2026 - 03:47:45 EST


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@xxxxxxxxxxx>
---
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;
}
--
2.43.0