forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/pxa/tosa.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * tosa.c -- SoC audio for Tosa
34 *
....@@ -7,15 +8,9 @@
78 * Authors: Liam Girdwood <lrg@slimlogic.co.uk>
89 * Richard Purdie <richard@openedhand.com>
910 *
10
- * This program is free software; you can redistribute it and/or modify it
11
- * under the terms of the GNU General Public License as published by the
12
- * Free Software Foundation; either version 2 of the License, or (at your
13
- * option) any later version.
14
- *
1511 * GPIO's
1612 * 1 - Jack Insertion
1713 * 5 - Hookswitch (headset answer/hang up switch)
18
- *
1914 */
2015
2116 #include <linux/module.h>
....@@ -77,7 +72,7 @@
7772
7873 static int tosa_startup(struct snd_pcm_substream *substream)
7974 {
80
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
75
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
8176
8277 /* check the jack status at stream startup */
8378 tosa_ext_control(&rtd->card->dapm);
....@@ -182,24 +177,28 @@
182177 tosa_set_spk),
183178 };
184179
180
+SND_SOC_DAILINK_DEFS(ac97,
181
+ DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97")),
182
+ DAILINK_COMP_ARRAY(COMP_CODEC("wm9712-codec", "wm9712-hifi")),
183
+ DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
184
+
185
+SND_SOC_DAILINK_DEFS(ac97_aux,
186
+ DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97-aux")),
187
+ DAILINK_COMP_ARRAY(COMP_CODEC("wm9712-codec", "wm9712-aux")),
188
+ DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
189
+
185190 static struct snd_soc_dai_link tosa_dai[] = {
186191 {
187192 .name = "AC97",
188193 .stream_name = "AC97 HiFi",
189
- .cpu_dai_name = "pxa2xx-ac97",
190
- .codec_dai_name = "wm9712-hifi",
191
- .platform_name = "pxa-pcm-audio",
192
- .codec_name = "wm9712-codec",
193194 .ops = &tosa_ops,
195
+ SND_SOC_DAILINK_REG(ac97),
194196 },
195197 {
196198 .name = "AC97 Aux",
197199 .stream_name = "AC97 Aux",
198
- .cpu_dai_name = "pxa2xx-ac97-aux",
199
- .codec_dai_name = "wm9712-aux",
200
- .platform_name = "pxa-pcm-audio",
201
- .codec_name = "wm9712-codec",
202200 .ops = &tosa_ops,
201
+ SND_SOC_DAILINK_REG(ac97_aux),
203202 },
204203 };
205204