ASoC: rockchip: spdifrx: 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: I8de05cf709187afd406775998f58ed5ebdb39d38
This commit is contained in:
Sugar Zhang
2024-07-19 16:50:10 +08:00
committed by Tao Huang
parent 1564c3cdde
commit 1f1211c186

View File

@@ -328,6 +328,12 @@ static int rk_spdifrx_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_spdifrx_component,
&rk_spdifrx_dai, 1);
@@ -336,12 +342,6 @@ static int rk_spdifrx_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: