forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/pxa/corgi.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * corgi.c -- SoC audio for Corgi
34 *
....@@ -6,11 +7,6 @@
67 *
78 * Authors: Liam Girdwood <lrg@slimlogic.co.uk>
89 * Richard Purdie <richard@openedhand.com>
9
- *
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.
1410 */
1511
1612 #include <linux/module.h>
....@@ -100,7 +96,7 @@
10096
10197 static int corgi_startup(struct snd_pcm_substream *substream)
10298 {
103
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
99
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
104100
105101 /* check the jack status at stream startup */
106102 corgi_ext_control(&rtd->card->dapm);
....@@ -119,9 +115,9 @@
119115 static int corgi_hw_params(struct snd_pcm_substream *substream,
120116 struct snd_pcm_hw_params *params)
121117 {
122
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
123
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
124
- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
118
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
119
+ struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
120
+ struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
125121 unsigned int clk = 0;
126122 int ret = 0;
127123
....@@ -260,16 +256,18 @@
260256 };
261257
262258 /* corgi digital audio interface glue - connects codec <--> CPU */
259
+SND_SOC_DAILINK_DEFS(wm8731,
260
+ DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-i2s")),
261
+ DAILINK_COMP_ARRAY(COMP_CODEC("wm8731.0-001b", "wm8731-hifi")),
262
+ DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
263
+
263264 static struct snd_soc_dai_link corgi_dai = {
264265 .name = "WM8731",
265266 .stream_name = "WM8731",
266
- .cpu_dai_name = "pxa2xx-i2s",
267
- .codec_dai_name = "wm8731-hifi",
268
- .platform_name = "pxa-pcm-audio",
269
- .codec_name = "wm8731.0-001b",
270267 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
271268 SND_SOC_DAIFMT_CBS_CFS,
272269 .ops = &corgi_ops,
270
+ SND_SOC_DAILINK_REG(wm8731),
273271 };
274272
275273 /* corgi audio machine driver */