16 #include <linux/module.h>
33 .stream_name =
"ab8500_0",
34 .cpu_dai_name =
"ux500-msp-i2s.1",
35 .codec_dai_name =
"ab8500-codec-dai.0",
36 .platform_name =
"ux500-pcm.0",
37 .codec_name =
"ab8500-codec.0",
43 .stream_name =
"ab8500_1",
44 .cpu_dai_name =
"ux500-msp-i2s.3",
45 .codec_dai_name =
"ab8500-codec-dai.1",
46 .platform_name =
"ux500-pcm.0",
47 .codec_name =
"ab8500-codec.0",
54 .name =
"MOP500-card",
60 static void mop500_of_node_put(
void)
64 for (i = 0; i < 2; i++) {
65 if (mop500_dai_links[i].cpu_of_node)
67 mop500_dai_links[i].cpu_of_node);
68 if (mop500_dai_links[i].codec_of_node)
70 mop500_dai_links[i].codec_of_node);
84 if (!(msp_np[0] && msp_np[1] && codec_np)) {
85 dev_err(&pdev->
dev,
"Phandle missing or invalid\n");
90 for (i = 0; i < 2; i++) {
107 dev_dbg(&pdev->
dev,
"%s: Enter.\n", __func__);
109 mop500_card.
dev = &pdev->
dev;
112 ret = mop500_of_probe(pdev, np);
117 dev_dbg(&pdev->
dev,
"%s: Card %s: Set platform drvdata.\n",
118 __func__, mop500_card.
name);
119 platform_set_drvdata(pdev, &mop500_card);
121 snd_soc_card_set_drvdata(&mop500_card,
NULL);
123 dev_dbg(&pdev->
dev,
"%s: Card %s: num_links = %d\n",
125 dev_dbg(&pdev->
dev,
"%s: Card %s: DAI-link 0: name = %s\n",
126 __func__, mop500_card.
name, mop500_card.
dai_link[0].name);
127 dev_dbg(&pdev->
dev,
"%s: Card %s: DAI-link 0: stream_name = %s\n",
128 __func__, mop500_card.
name,
129 mop500_card.
dai_link[0].stream_name);
134 "Error: snd_soc_register_card failed (%d)!\n", ret);
141 struct snd_soc_card *mop500_card = platform_get_drvdata(pdev);
147 mop500_of_node_put();
152 static const struct of_device_id snd_soc_mop500_match[] = {
153 { .compatible =
"stericsson,snd-soc-mop500", },
160 .name =
"snd-soc-mop500",
161 .of_match_table = snd_soc_mop500_match,
163 .probe = mop500_probe,