forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/tegra/tegra_wm9712.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * tegra20_wm9712.c - Tegra machine ASoC driver for boards using WM9712 codec.
34 *
....@@ -5,16 +6,6 @@
56 *
67 * Partly based on code copyright/by:
78 * Copyright 2011,2012 Toradex Inc.
8
- *
9
- * This program is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU General Public License
11
- * version 2 as published by the Free Software Foundation.
12
- *
13
- * This program is distributed in the hope that it will be useful, but
14
- * WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
- * General Public License for more details.
17
- *
189 */
1910
2011 #include <linux/module.h>
....@@ -49,12 +40,16 @@
4940 return snd_soc_dapm_force_enable_pin(&rtd->card->dapm, "Mic Bias");
5041 }
5142
43
+SND_SOC_DAILINK_DEFS(hifi,
44
+ DAILINK_COMP_ARRAY(COMP_EMPTY()),
45
+ DAILINK_COMP_ARRAY(COMP_CODEC("wm9712-codec", "wm9712-hifi")),
46
+ DAILINK_COMP_ARRAY(COMP_EMPTY()));
47
+
5248 static struct snd_soc_dai_link tegra_wm9712_dai = {
5349 .name = "AC97 HiFi",
5450 .stream_name = "AC97 HiFi",
55
- .codec_dai_name = "wm9712-hifi",
56
- .codec_name = "wm9712-codec",
5751 .init = tegra_wm9712_init,
52
+ SND_SOC_DAILINK_REG(hifi),
5853 };
5954
6055 static struct snd_soc_card snd_soc_tegra_wm9712 = {
....@@ -102,16 +97,16 @@
10297 if (ret)
10398 goto codec_unregister;
10499
105
- tegra_wm9712_dai.cpu_of_node = of_parse_phandle(np,
100
+ tegra_wm9712_dai.cpus->of_node = of_parse_phandle(np,
106101 "nvidia,ac97-controller", 0);
107
- if (!tegra_wm9712_dai.cpu_of_node) {
102
+ if (!tegra_wm9712_dai.cpus->of_node) {
108103 dev_err(&pdev->dev,
109104 "Property 'nvidia,ac97-controller' missing or invalid\n");
110105 ret = -EINVAL;
111106 goto codec_unregister;
112107 }
113108
114
- tegra_wm9712_dai.platform_of_node = tegra_wm9712_dai.cpu_of_node;
109
+ tegra_wm9712_dai.platforms->of_node = tegra_wm9712_dai.cpus->of_node;
115110
116111 ret = tegra_asoc_utils_init(&machine->util_data, &pdev->dev);
117112 if (ret)
....@@ -119,19 +114,17 @@
119114
120115 ret = tegra_asoc_utils_set_ac97_rate(&machine->util_data);
121116 if (ret)
122
- goto asoc_utils_fini;
117
+ goto codec_unregister;
123118
124119 ret = snd_soc_register_card(card);
125120 if (ret) {
126121 dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n",
127122 ret);
128
- goto asoc_utils_fini;
123
+ goto codec_unregister;
129124 }
130125
131126 return 0;
132127
133
-asoc_utils_fini:
134
- tegra_asoc_utils_fini(&machine->util_data);
135128 codec_unregister:
136129 platform_device_del(machine->codec);
137130 codec_put:
....@@ -145,8 +138,6 @@
145138 struct tegra_wm9712 *machine = snd_soc_card_get_drvdata(card);
146139
147140 snd_soc_unregister_card(card);
148
-
149
- tegra_asoc_utils_fini(&machine->util_data);
150141
151142 platform_device_unregister(machine->codec);
152143