Skip to content

Commit ea532c2

Browse files
TE-N-ShengjiuWangbroonie
authored andcommitted
ASoC: fsl_aud2htx: register platform component before registering cpu dai
There is no defer probe when adding platform component to snd_soc_pcm_runtime(rtd), the code is in snd_soc_add_pcm_runtime() snd_soc_register_card() -> snd_soc_bind_card() -> snd_soc_add_pcm_runtime() -> adding cpu dai -> adding codec dai -> adding platform component. So if the platform component is not ready at that time, then the sound card still registered successfully, but platform component is empty, the sound card can't be used. As there is defer probe checking for cpu dai component, then register platform component before cpu dai to avoid such issue. And the behavior of imx_pcm_dma_init() is same as common devm_snd_dmaengine_pcm_register(), so use devm_snd_dmaengine_pcm_register() instead Signed-off-by: Shengjiu Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 2a91980 commit ea532c2

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

sound/soc/fsl/fsl_aud2htx.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,16 @@ static int fsl_aud2htx_probe(struct platform_device *pdev)
234234

235235
regcache_cache_only(aud2htx->regmap, true);
236236

237+
/*
238+
* Register platform component before registering cpu dai for there
239+
* is not defer probe for platform component in snd_soc_add_pcm_runtime().
240+
*/
241+
ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0);
242+
if (ret) {
243+
dev_err(&pdev->dev, "failed to pcm register\n");
244+
return ret;
245+
}
246+
237247
ret = devm_snd_soc_register_component(&pdev->dev,
238248
&fsl_aud2htx_component,
239249
&fsl_aud2htx_dai, 1);
@@ -242,10 +252,6 @@ static int fsl_aud2htx_probe(struct platform_device *pdev)
242252
return ret;
243253
}
244254

245-
ret = imx_pcm_dma_init(pdev);
246-
if (ret)
247-
dev_err(&pdev->dev, "failed to init imx pcm dma: %d\n", ret);
248-
249255
return ret;
250256
}
251257

0 commit comments

Comments
 (0)