]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: cs42l42: Use new SoundWire enumeration helper
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Tue, 12 May 2026 10:30:07 +0000 (11:30 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 12 May 2026 10:47:00 +0000 (19:47 +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-4-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/cs42l42-sdw.c

index d5999ad9ff9b484714643eb3cd9ed57e971906cd..b8256ce0b8fbeecf791ac1fff30056e9af642ea8 100644 (file)
@@ -433,19 +433,16 @@ static const struct reg_sequence cs42l42_soft_reboot_seq[] = {
 static int cs42l42_sdw_handle_unattach(struct cs42l42_private *cs42l42)
 {
        struct sdw_slave *peripheral = cs42l42->sdw_peripheral;
+       int ret;
 
        if (!peripheral->unattach_request)
                return 0;
 
        /* Cannot access registers until master re-attaches. */
        dev_dbg(&peripheral->dev, "Wait for initialization_complete\n");
-       if (!wait_for_completion_timeout(&peripheral->initialization_complete,
-                                        msecs_to_jiffies(5000))) {
-               dev_err(&peripheral->dev, "initialization_complete timed out\n");
-               return -ETIMEDOUT;
-       }
-
-       peripheral->unattach_request = 0;
+       ret = sdw_slave_wait_for_init(peripheral, 5000);
+       if (ret)
+               return ret;
 
        /*
         * After a bus reset there must be a reconfiguration reset to