Skip to content

Commit d4fcd06

Browse files
TE-N-ShengjiuWanggregkh
authored andcommitted
ASoC: fsl_audmix: register card device depends on 'dais' property
[ Upstream commit 294a60e ] In order to make the audmix device linked by audio graph card, make 'dais' property to be optional. If 'dais' property exists, then register the imx-audmix card driver. otherwise, it should be linked by audio graph card. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://patch.msgid.link/20250226100508.2352568-5-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent d981c3d commit d4fcd06

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

sound/soc/fsl/fsl_audmix.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -488,11 +488,17 @@ static int fsl_audmix_probe(struct platform_device *pdev)
488488
goto err_disable_pm;
489489
}
490490

491-
priv->pdev = platform_device_register_data(dev, "imx-audmix", 0, NULL, 0);
492-
if (IS_ERR(priv->pdev)) {
493-
ret = PTR_ERR(priv->pdev);
494-
dev_err(dev, "failed to register platform: %d\n", ret);
495-
goto err_disable_pm;
491+
/*
492+
* If dais property exist, then register the imx-audmix card driver.
493+
* otherwise, it should be linked by audio graph card.
494+
*/
495+
if (of_find_property(pdev->dev.of_node, "dais", NULL)) {
496+
priv->pdev = platform_device_register_data(dev, "imx-audmix", 0, NULL, 0);
497+
if (IS_ERR(priv->pdev)) {
498+
ret = PTR_ERR(priv->pdev);
499+
dev_err(dev, "failed to register platform: %d\n", ret);
500+
goto err_disable_pm;
501+
}
496502
}
497503

498504
return 0;

0 commit comments

Comments
 (0)