ASoC: rockchip: spdif: Register PCM before DAI component

API snd_soc_register_component will try to rebind card per
each component register. and the ASoC allow no-pcm card instance.

  devm_snd_soc_register_component
      snd_soc_try_rebind_card
          snd_soc_bind_card
              snd_soc_add_pcm_runtime
  devm_snd_dmaengine_pcm_register

So, we should register PCM before DAI component.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: Id099f4774e040263a370da36427529d45071c173
This commit is contained in:
Sugar Zhang
2024-07-19 16:49:11 +08:00
committed by Tao Huang
parent c1ac114227
commit 1564c3cdde

View File

@@ -399,6 +399,12 @@ static int rk_spdif_probe(struct platform_device *pdev)
goto err_pm_runtime;
}
ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0);
if (ret) {
dev_err(&pdev->dev, "Could not register PCM\n");
goto err_pm_suspend;
}
ret = devm_snd_soc_register_component(&pdev->dev,
&rk_spdif_component,
&rk_spdif_dai, 1);
@@ -407,12 +413,6 @@ static int rk_spdif_probe(struct platform_device *pdev)
goto err_pm_suspend;
}
ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0);
if (ret) {
dev_err(&pdev->dev, "Could not register PCM\n");
goto err_pm_suspend;
}
return 0;
err_pm_suspend: