forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/sound/soc/pxa/poodle.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * poodle.c -- SoC audio for Poodle
34 *
....@@ -6,12 +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.
14
- *
1510 */
1611
1712 #include <linux/module.h>
....@@ -61,7 +56,7 @@
6156 snd_soc_dapm_disable_pin(dapm, "Headphone Jack");
6257 }
6358
64
- /* set the enpoints to their new connetion states */
59
+ /* set the endpoints to their new connection states */
6560 if (poodle_spk_func == POODLE_SPK_ON)
6661 snd_soc_dapm_enable_pin(dapm, "Ext Spk");
6762 else
....@@ -73,7 +68,7 @@
7368
7469 static int poodle_startup(struct snd_pcm_substream *substream)
7570 {
76
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
71
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
7772
7873 /* check the jack status at stream startup */
7974 poodle_ext_control(&rtd->card->dapm);
....@@ -94,9 +89,9 @@
9489 static int poodle_hw_params(struct snd_pcm_substream *substream,
9590 struct snd_pcm_hw_params *params)
9691 {
97
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
98
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
99
- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
92
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
93
+ struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
94
+ struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
10095 unsigned int clk = 0;
10196 int ret = 0;
10297
....@@ -224,16 +219,18 @@
224219 };
225220
226221 /* poodle digital audio interface glue - connects codec <--> CPU */
222
+SND_SOC_DAILINK_DEFS(wm8731,
223
+ DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-i2s")),
224
+ DAILINK_COMP_ARRAY(COMP_CODEC("wm8731.0-001b", "wm8731-hifi")),
225
+ DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
226
+
227227 static struct snd_soc_dai_link poodle_dai = {
228228 .name = "WM8731",
229229 .stream_name = "WM8731",
230
- .cpu_dai_name = "pxa2xx-i2s",
231
- .codec_dai_name = "wm8731-hifi",
232
- .platform_name = "pxa-pcm-audio",
233
- .codec_name = "wm8731.0-001b",
234230 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
235231 SND_SOC_DAIFMT_CBS_CFS,
236232 .ops = &poodle_ops,
233
+ SND_SOC_DAILINK_REG(wm8731),
237234 };
238235
239236 /* poodle audio machine driver */