aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Trimmer <simont@opensource.cirrus.com>2023-04-14 14:37:51 +0100
committerMark Brown <broonie@kernel.org>2023-04-17 12:55:49 +0100
commit440c2d38950f738d7a35d3d29533728e74586d54 (patch)
tree145b3e7207dc255a32701f1ddb783fd50b2a95ee
parentASoC: cs35l56: Allow a wider range for reset pulse width (diff)
downloadlinux-rng-440c2d38950f738d7a35d3d29533728e74586d54.tar.xz
linux-rng-440c2d38950f738d7a35d3d29533728e74586d54.zip
ASoC: cs35l56: Wait for init_complete in cs35l56_component_probe()
Moving the wait from the beginning of the cs35l56_dsp_work() into cs35l56_component_probe() will prevent the limbo situation that is an artifact of the two stage SoundWire driver probe and initialisation where the card is all registered and shows in ALSA but doesn't actually work because the hardware didn't enumerate. The other bus drivers perform the probe and init sequentially and are not susceptible to this issue. Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230414133753.653139-4-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/cs35l56.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sound/soc/codecs/cs35l56.c b/sound/soc/codecs/cs35l56.c
index d60095162bfa..ab2e663af6c2 100644
--- a/sound/soc/codecs/cs35l56.c
+++ b/sound/soc/codecs/cs35l56.c
@@ -875,13 +875,6 @@ static void cs35l56_dsp_work(struct work_struct *work)
unsigned int val;
int ret = 0;
- if (!cs35l56->init_done &&
- !wait_for_completion_timeout(&cs35l56->init_completion,
- msecs_to_jiffies(5000))) {
- dev_err(cs35l56->dev, "%s: init_completion timed out\n", __func__);
- goto complete;
- }
-
if (!cs35l56->init_done)
goto complete;
@@ -980,6 +973,12 @@ static int cs35l56_component_probe(struct snd_soc_component *component)
BUILD_BUG_ON(ARRAY_SIZE(cs35l56_tx_input_texts) != ARRAY_SIZE(cs35l56_tx_input_values));
+ if (!wait_for_completion_timeout(&cs35l56->init_completion,
+ msecs_to_jiffies(5000))) {
+ dev_err(cs35l56->dev, "%s: init_completion timed out\n", __func__);
+ return -ENODEV;
+ }
+
cs35l56->component = component;
wm_adsp2_component_probe(&cs35l56->dsp, component);