forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/pxa/spitz.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * spitz.c -- SoC audio for Sharp SL-Cxx00 models Spitz, Borzoi and Akita
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>
....@@ -110,7 +105,7 @@
110105
111106 static int spitz_startup(struct snd_pcm_substream *substream)
112107 {
113
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
108
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
114109
115110 /* check the jack status at stream startup */
116111 spitz_ext_control(&rtd->card->dapm);
....@@ -121,9 +116,9 @@
121116 static int spitz_hw_params(struct snd_pcm_substream *substream,
122117 struct snd_pcm_hw_params *params)
123118 {
124
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
125
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
126
- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
119
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
120
+ struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
121
+ struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
127122 unsigned int clk = 0;
128123 int ret = 0;
129124
....@@ -257,16 +252,18 @@
257252 };
258253
259254 /* spitz digital audio interface glue - connects codec <--> CPU */
255
+SND_SOC_DAILINK_DEFS(wm8750,
256
+ DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-i2s")),
257
+ DAILINK_COMP_ARRAY(COMP_CODEC("wm8750.0-001b", "wm8750-hifi")),
258
+ DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
259
+
260260 static struct snd_soc_dai_link spitz_dai = {
261261 .name = "wm8750",
262262 .stream_name = "WM8750",
263
- .cpu_dai_name = "pxa2xx-i2s",
264
- .codec_dai_name = "wm8750-hifi",
265
- .platform_name = "pxa-pcm-audio",
266
- .codec_name = "wm8750.0-001b",
267263 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
268264 SND_SOC_DAIFMT_CBS_CFS,
269265 .ops = &spitz_ops,
266
+ SND_SOC_DAILINK_REG(wm8750),
270267 };
271268
272269 /* spitz audio machine driver */