forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 1f93a7dfd1f8d5ff7a5c53246c7534fe2332d6f4
kernel/sound/soc/pxa/z2.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/sound/soc/pxa/z2.c
34 *
....@@ -5,10 +6,6 @@
56 *
67 * Copyright (C) 2009 Ken McGuire <kenm@desertweyr.com>
78 * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com>
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License version 2 as
11
- * published by the Free Software Foundation.
129 */
1310
1411 #include <linux/module.h>
....@@ -36,9 +33,9 @@
3633 static int z2_hw_params(struct snd_pcm_substream *substream,
3734 struct snd_pcm_hw_params *params)
3835 {
39
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
40
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
41
- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
36
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
37
+ struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
38
+ struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
4239 unsigned int clk = 0;
4340 int ret = 0;
4441
....@@ -157,17 +154,19 @@
157154 };
158155
159156 /* z2 digital audio interface glue - connects codec <--> CPU */
157
+SND_SOC_DAILINK_DEFS(wm8750,
158
+ DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-i2s")),
159
+ DAILINK_COMP_ARRAY(COMP_CODEC("wm8750.0-001b", "wm8750-hifi")),
160
+ DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
161
+
160162 static struct snd_soc_dai_link z2_dai = {
161163 .name = "wm8750",
162164 .stream_name = "WM8750",
163
- .cpu_dai_name = "pxa2xx-i2s",
164
- .codec_dai_name = "wm8750-hifi",
165
- .platform_name = "pxa-pcm-audio",
166
- .codec_name = "wm8750.0-001b",
167165 .init = z2_wm8750_init,
168166 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
169167 SND_SOC_DAIFMT_CBS_CFS,
170168 .ops = &z2_ops,
169
+ SND_SOC_DAILINK_REG(wm8750),
171170 };
172171
173172 /* z2 audio machine driver */