The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: broonie@kernel.org, vkoul@kernel.org, lee@kernel.org
Cc: lgirdwood@gmail.com, pierre-louis.bossart@linux.dev,
	yung-chuan.liao@linux.intel.com, peter.ujfalusi@linux.intel.com,
	oder_chiou@realtek.com, jack.yu@realtek.com,
	shumingf@realtek.com, srini@kernel.org,
	linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org, patches@opensource.cirrus.com
Subject: [PATCH 04/10] ASoC: rt5682: Use new SoundWire enumeration helper
Date: Wed,  3 Jun 2026 15:44:37 +0100	[thread overview]
Message-ID: <20260603144443.593230-5-ckeepax@opensource.cirrus.com> (raw)
In-Reply-To: <20260603144443.593230-1-ckeepax@opensource.cirrus.com>

Now the new wait for SoundWire enumeration helper no longer depends on
unattach_request it is safe to use from probe time. Update the driver
to use the new core helper.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
 sound/soc/codecs/rt5682.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c
index d39f8e4f3474c..4b82e07d3b2c7 100644
--- a/sound/soc/codecs/rt5682.c
+++ b/sound/soc/codecs/rt5682.c
@@ -2929,20 +2929,14 @@ static int rt5682_probe(struct snd_soc_component *component)
 {
 	struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component);
 	struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component);
-	struct sdw_slave *slave;
-	unsigned long time;
+	int ret;
 
 	rt5682->component = component;
 
 	if (rt5682->is_sdw) {
-		slave = rt5682->slave;
-		time = wait_for_completion_timeout(
-			&slave->initialization_complete,
-			msecs_to_jiffies(RT5682_PROBE_TIMEOUT));
-		if (!time) {
-			dev_err(&slave->dev, "Initialization not complete, timed out\n");
-			return -ETIMEDOUT;
-		}
+		ret = sdw_slave_wait_for_init(rt5682->slave, RT5682_PROBE_TIMEOUT);
+		if (ret)
+			return ret;
 	}
 
 	snd_soc_dapm_disable_pin(dapm, "MICBIAS");
-- 
2.47.3


  parent reply	other threads:[~2026-06-03 14:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-03 14:44 [PATCH 00/10] Expand SoundWire enumeration helper coverage Charles Keepax
2026-06-03 14:44 ` [PATCH 01/10] soundwire: Always wait for initialisation of unattached devices Charles Keepax
2026-06-04  6:44   ` Vinod Koul
2026-06-03 14:44 ` [PATCH 02/10] ASoC: wsa881x: Use new SoundWire enumeration helper Charles Keepax
2026-06-03 14:44 ` [PATCH 03/10] mfd: cs42l43: " Charles Keepax
2026-06-04 11:04   ` Mark Brown
2026-06-04 11:07     ` Mark Brown
2026-06-04 12:05     ` Charles Keepax
2026-06-03 14:44 ` Charles Keepax [this message]
2026-06-04 11:05   ` [PATCH 04/10] ASoC: rt5682: " Mark Brown
2026-06-03 14:44 ` [PATCH 05/10] ASoC: pm4125: " Charles Keepax
2026-06-03 14:44 ` [PATCH 06/10] ASoC: wcd937x: " Charles Keepax
2026-06-03 14:44 ` [PATCH 07/10] ASoC: wcd938x: " Charles Keepax
2026-06-03 14:44 ` [PATCH 08/10] ASoC: wcd939x: " Charles Keepax
2026-06-03 14:44 ` [PATCH 09/10] ASoC: SDCA: " Charles Keepax
2026-06-03 14:44 ` [PATCH 10/10] ASoC: cs35l56: Remove unnecessary conditionals waiting for enumeration Charles Keepax

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260603144443.593230-5-ckeepax@opensource.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=broonie@kernel.org \
    --cc=jack.yu@realtek.com \
    --cc=lee@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=oder_chiou@realtek.com \
    --cc=patches@opensource.cirrus.com \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=shumingf@realtek.com \
    --cc=srini@kernel.org \
    --cc=vkoul@kernel.org \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox