13 #include <linux/module.h>
20 #include "../codecs/sgtl5000.h"
23 #define DAI_NAME_SIZE 32
44 dev_err(dev,
"could not set codec driver clock params\n");
66 int int_port, ext_port;
69 ret = of_property_read_u32(np,
"mux-int-port", &int_port);
71 dev_err(&pdev->
dev,
"mux-int-port missing or invalid\n");
74 ret = of_property_read_u32(np,
"mux-ext-port", &ext_port);
76 dev_err(&pdev->
dev,
"mux-ext-port missing or invalid\n");
94 dev_err(&pdev->
dev,
"audmux internal port setup failed\n");
101 dev_err(&pdev->
dev,
"audmux external port setup failed\n");
107 if (!ssi_np || !codec_np) {
108 dev_err(&pdev->
dev,
"phandle missing or invalid\n");
115 dev_err(&pdev->
dev,
"failed to find SSI platform device\n");
121 dev_err(&pdev->
dev,
"failed to find codec platform device\n");
135 ret = of_property_read_u32(codec_np,
"clock-frequency",
139 "clock-frequency missing or invalid\n");
147 data->
dai.name =
"HiFi";
148 data->
dai.stream_name =
"HiFi";
149 data->
dai.codec_dai_name =
"sgtl5000";
150 data->
dai.codec_of_node = codec_np;
151 data->
dai.cpu_dai_name = dev_name(&ssi_pdev->
dev);
152 data->
dai.platform_name =
"imx-pcm-audio";
153 data->
dai.init = &imx_sgtl5000_dai_init;
164 data->
card.num_links = 1;
165 data->
card.dai_link = &data->
dai;
166 data->
card.dapm_widgets = imx_sgtl5000_dapm_widgets;
167 data->
card.num_dapm_widgets =
ARRAY_SIZE(imx_sgtl5000_dapm_widgets);
171 dev_err(&pdev->
dev,
"snd_soc_register_card failed (%d)\n", ret);
175 platform_set_drvdata(pdev, data);
182 of_node_put(codec_np);
200 static const struct of_device_id imx_sgtl5000_dt_ids[] = {
201 { .compatible =
"fsl,imx-audio-sgtl5000", },
208 .name =
"imx-sgtl5000",
210 .of_match_table = imx_sgtl5000_dt_ids,
212 .probe = imx_sgtl5000_probe,