forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 1f93a7dfd1f8d5ff7a5c53246c7534fe2332d6f4
kernel/sound/soc/fsl/pcm030-audio-fabric.c
....@@ -1,14 +1,10 @@
1
-/*
2
- * Phytec pcm030 driver for the PSC of the Freescale MPC52xx
3
- * configured as AC97 interface
4
- *
5
- * Copyright 2008 Jon Smirl, Digispeaker
6
- * Author: Jon Smirl <jonsmirl@gmail.com>
7
- *
8
- * This file is licensed under the terms of the GNU General Public License
9
- * version 2. This program is licensed "as is" without any warranty of any
10
- * kind, whether express or implied.
11
- */
1
+// SPDX-License-Identifier: GPL-2.0
2
+//
3
+// Phytec pcm030 driver for the PSC of the Freescale MPC52xx
4
+// configured as AC97 interface
5
+//
6
+// Copyright 2008 Jon Smirl, Digispeaker
7
+// Author: Jon Smirl <jonsmirl@gmail.com>
128
139 #include <linux/init.h>
1410 #include <linux/module.h>
....@@ -27,20 +23,26 @@
2723 struct platform_device *codec_device;
2824 };
2925
26
+SND_SOC_DAILINK_DEFS(analog,
27
+ DAILINK_COMP_ARRAY(COMP_CPU("mpc5200-psc-ac97.0")),
28
+ DAILINK_COMP_ARRAY(COMP_CODEC("wm9712-codec", "wm9712-hifi")),
29
+ DAILINK_COMP_ARRAY(COMP_EMPTY()));
30
+
31
+SND_SOC_DAILINK_DEFS(iec958,
32
+ DAILINK_COMP_ARRAY(COMP_CPU("mpc5200-psc-ac97.1")),
33
+ DAILINK_COMP_ARRAY(COMP_CODEC("wm9712-codec", "wm9712-aux")),
34
+ DAILINK_COMP_ARRAY(COMP_EMPTY()));
35
+
3036 static struct snd_soc_dai_link pcm030_fabric_dai[] = {
3137 {
3238 .name = "AC97.0",
3339 .stream_name = "AC97 Analog",
34
- .codec_dai_name = "wm9712-hifi",
35
- .cpu_dai_name = "mpc5200-psc-ac97.0",
36
- .codec_name = "wm9712-codec",
40
+ SND_SOC_DAILINK_REG(analog),
3741 },
3842 {
3943 .name = "AC97.1",
4044 .stream_name = "AC97 IEC958",
41
- .codec_dai_name = "wm9712-aux",
42
- .cpu_dai_name = "mpc5200-psc-ac97.1",
43
- .codec_name = "wm9712-codec",
45
+ SND_SOC_DAILINK_REG(iec958),
4446 },
4547 };
4648
....@@ -57,6 +59,7 @@
5759 struct device_node *platform_np;
5860 struct snd_soc_card *card = &pcm030_card;
5961 struct pcm030_audio_data *pdata;
62
+ struct snd_soc_dai_link *dai_link;
6063 int ret;
6164 int i;
6265
....@@ -78,8 +81,8 @@
7881 return -ENODEV;
7982 }
8083
81
- for (i = 0; i < card->num_links; i++)
82
- card->dai_link[i].platform_of_node = platform_np;
84
+ for_each_card_prelinks(card, i, dai_link)
85
+ dai_link->platforms->of_node = platform_np;
8386
8487 ret = request_module("snd-soc-wm9712");
8588 if (ret)