[PATCH] ASoC: pcm3168a: Leave cache-only mode before resetting on resume

From: Haowen Tu

Date: Fri Nov 13 2026 - 02:53:39 EST


pcm3168a_rt_suspend() puts the regmap in cache-only mode, but the resume
callback calls pcm3168a_reset() before leaving that mode. Both writes to
PCM3168A_RST_SMODE therefore return success without reaching the device.
The register is volatile, so the writes are not cached and the subsequent
regcache_sync() cannot replay the reset sequence either.

Leave cache-only mode after enabling the clock and supplies, before
issuing the reset writes. Restore cache-only mode before powering down
if either the reset or the cache sync fails.

Fixes: a9b17a638af5 ("ASoC: pcm3168a: Add driver for pcm3168a codec")
Signed-off-by: Haowen Tu <tuhaowen@xxxxxxxxxxxxx>
---
sound/soc/codecs/pcm3168a.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/pcm3168a.c b/sound/soc/codecs/pcm3168a.c
index 11fd948ecd27..bb539b9dd0b8 100644
--- a/sound/soc/codecs/pcm3168a.c
+++ b/sound/soc/codecs/pcm3168a.c
@@ -855,14 +855,14 @@ static int pcm3168a_rt_resume(struct device *dev)
goto err_clk;
}

+ regcache_cache_only(pcm3168a->regmap, false);
+
ret = pcm3168a_reset(pcm3168a);
if (ret) {
dev_err(dev, "Failed to reset device: %d\n", ret);
goto err_regulator;
}

- regcache_cache_only(pcm3168a->regmap, false);
-
regcache_mark_dirty(pcm3168a->regmap);

ret = regcache_sync(pcm3168a->regmap);
@@ -874,6 +874,7 @@ static int pcm3168a_rt_resume(struct device *dev)
return 0;

err_regulator:
+ regcache_cache_only(pcm3168a->regmap, true);
regulator_bulk_disable(ARRAY_SIZE(pcm3168a->supplies),
pcm3168a->supplies);
err_clk:
--
2.50.1