From 95c94eae1d31ead2e2d57f7efc456cd2617e12fe Mon Sep 17 00:00:00 2001 From: Michael Grzeschik Date: Fri, 28 Jun 2013 17:56:42 +0200 Subject: ASoC: imx-mc13783: make devicetree capable und use fsl,ssi Signed-off-by: Michael Grzeschik --- sound/soc/fsl/imx-mc13783.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sound/soc/fsl/imx-mc13783.c b/sound/soc/fsl/imx-mc13783.c index 9df173c091a6..e555cd554730 100644 --- a/sound/soc/fsl/imx-mc13783.c +++ b/sound/soc/fsl/imx-mc13783.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -102,8 +103,20 @@ static int imx_mc13783_probe(struct platform_device *pdev) { int ret; + struct device_node *ssi_np; + imx_mc13783.dev = &pdev->dev; + ssi_np = of_parse_phandle(pdev->dev.of_node, "fsl,ssi", 0); + if (ssi_np) { + imx_mc13783_dai_mc13783[0].cpu_of_node = ssi_np; + imx_mc13783_dai_mc13783[0].platform_of_node = ssi_np; + imx_mc13783_dai_mc13783[0].cpu_dai_name = NULL; + imx_mc13783_dai_mc13783[0].platform_name = NULL; + } else { + dev_err(&pdev->dev, "No valid ssi phandle found\n"); + } + ret = snd_soc_register_card(&imx_mc13783); if (ret) { dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", @@ -155,10 +168,17 @@ static int imx_mc13783_remove(struct platform_device *pdev) return 0; } +static const struct of_device_id imx_mc13783_dt_ids[] = { + { .compatible = "fsl,imx-mc13783", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, imx_mc13783_dt_ids); + static struct platform_driver imx_mc13783_audio_driver = { .driver = { .name = "imx_mc13783", .owner = THIS_MODULE, + .of_match_table = imx_mc13783_dt_ids, }, .probe = imx_mc13783_probe, .remove = imx_mc13783_remove -- cgit v1.2.3