Skip to content

Commit 440c2d3

Browse files
simontrimmerbroonie
authored andcommitted
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>
1 parent b823961 commit 440c2d3

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

sound/soc/codecs/cs35l56.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -875,13 +875,6 @@ static void cs35l56_dsp_work(struct work_struct *work)
875875
unsigned int val;
876876
int ret = 0;
877877

878-
if (!cs35l56->init_done &&
879-
!wait_for_completion_timeout(&cs35l56->init_completion,
880-
msecs_to_jiffies(5000))) {
881-
dev_err(cs35l56->dev, "%s: init_completion timed out\n", __func__);
882-
goto complete;
883-
}
884-
885878
if (!cs35l56->init_done)
886879
goto complete;
887880

@@ -980,6 +973,12 @@ static int cs35l56_component_probe(struct snd_soc_component *component)
980973

981974
BUILD_BUG_ON(ARRAY_SIZE(cs35l56_tx_input_texts) != ARRAY_SIZE(cs35l56_tx_input_values));
982975

976+
if (!wait_for_completion_timeout(&cs35l56->init_completion,
977+
msecs_to_jiffies(5000))) {
978+
dev_err(cs35l56->dev, "%s: init_completion timed out\n", __func__);
979+
return -ENODEV;
980+
}
981+
983982
cs35l56->component = component;
984983
wm_adsp2_component_probe(&cs35l56->dsp, component);
985984

0 commit comments

Comments
 (0)