[PATCH 2/2] ASoC: cs35l56: set unattach_pending before SoundWire system reset

From: Cole Leavitt

Date: Tue Feb 17 2026 - 18:36:29 EST


The CS35L56 driver triggers a system reset after firmware download and
during initial probe when no hardware reset GPIO is available. This
reset physically detaches the codec from the SoundWire bus while the
driver waits for re-enumeration, which is expected and handled
gracefully.

However, the bus layer emits a dev_warn() for this intentional
transition to UNATTACHED because it cannot distinguish expected
detachments from genuine failures. This produces misleading warnings
on every boot for systems with CS35L56 codecs on SoundWire:

cs35l56 sdw:0:2:01fa:3556:01:0: Slave 2 state check1: UNATTACHED, status was 1
cs35l56 sdw:0:2:01fa:3556:01:1: Slave 1 state check1: UNATTACHED, status was 1

Set the unattach_pending flag on the SoundWire peripheral before
triggering a system reset in both the firmware patch path and the
initial probe soft reset path. This allows the bus layer to downgrade
the warning to dev_dbg() for these expected transitions.

Signed-off-by: Cole Leavitt <cole@xxxxxxxxx>
---
sound/soc/codecs/cs35l56.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/sound/soc/codecs/cs35l56.c b/sound/soc/codecs/cs35l56.c
index 2ff8b172b76e..6566350a59c7 100644
--- a/sound/soc/codecs/cs35l56.c
+++ b/sound/soc/codecs/cs35l56.c
@@ -807,6 +807,8 @@ static void cs35l56_patch(struct cs35l56_private *cs35l56, bool firmware_missing
reinit_completion(&cs35l56->init_completion);

cs35l56->soft_resetting = true;
+ if (cs35l56->sdw_peripheral)
+ cs35l56->sdw_peripheral->unattach_pending = true;
cs35l56_system_reset(&cs35l56->base, !!cs35l56->sdw_peripheral);

if (cs35l56->sdw_peripheral) {
@@ -1903,6 +1905,8 @@ int cs35l56_init(struct cs35l56_private *cs35l56)
if (!cs35l56->base.reset_gpio) {
dev_dbg(cs35l56->base.dev, "No reset gpio: using soft reset\n");
cs35l56->soft_resetting = true;
+ if (cs35l56->sdw_peripheral)
+ cs35l56->sdw_peripheral->unattach_pending = true;
cs35l56_system_reset(&cs35l56->base, !!cs35l56->sdw_peripheral);
if (cs35l56->sdw_peripheral) {
/* Keep alive while we wait for re-enumeration */
--
2.52.0