]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: cs35l56: Use new SoundWire enumeration helper
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Tue, 12 May 2026 10:30:06 +0000 (11:30 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 12 May 2026 10:46:59 +0000 (19:46 +0900)
Update the driver to use the new core helper that waits for the device
to enumerate on SoundWire and be initialised by the SoundWire core.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260512103022.1154645-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/cs35l56-sdw.c

index 9dc47fec1ea048caa0f4158d26206474cc132138..105d38b1c1878bff075c9eea42d526178fbb9333 100644 (file)
@@ -436,6 +436,7 @@ static const struct sdw_slave_ops cs35l56_sdw_ops = {
 static int __maybe_unused cs35l56_sdw_handle_unattach(struct cs35l56_private *cs35l56)
 {
        struct sdw_slave *peripheral = cs35l56->sdw_peripheral;
+       int ret;
 
        dev_dbg(cs35l56->base.dev, "attached:%u unattach_request:%u in_clock_stop_1:%u\n",
                cs35l56->sdw_attached, peripheral->unattach_request, cs35l56->sdw_in_clock_stop_1);
@@ -443,13 +444,10 @@ static int __maybe_unused cs35l56_sdw_handle_unattach(struct cs35l56_private *cs
        if (cs35l56->sdw_in_clock_stop_1 || peripheral->unattach_request) {
                /* Cannot access registers until bus is re-initialized. */
                dev_dbg(cs35l56->base.dev, "Wait for initialization_complete\n");
-               if (!wait_for_completion_timeout(&peripheral->initialization_complete,
-                                                msecs_to_jiffies(5000))) {
-                       dev_err(cs35l56->base.dev, "initialization_complete timed out\n");
-                       return -ETIMEDOUT;
-               }
+               ret = sdw_slave_wait_for_init(peripheral, 5000);
+               if (ret)
+                       return ret;
 
-               peripheral->unattach_request = 0;
                cs35l56->sdw_in_clock_stop_1 = false;
 
                /*