forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 1f93a7dfd1f8d5ff7a5c53246c7534fe2332d6f4
kernel/sound/soc/fsl/wm1133-ev1.c
....@@ -1,16 +1,11 @@
1
-/*
2
- * wm1133-ev1.c - Audio for WM1133-EV1 on i.MX31ADS
3
- *
4
- * Copyright (c) 2010 Wolfson Microelectronics plc
5
- * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
6
- *
7
- * Based on an earlier driver for the same hardware by Liam Girdwood.
8
- *
9
- * This program is free software; you can redistribute it and/or modify it
10
- * under the terms of the GNU General Public License as published by the
11
- * Free Software Foundation; either version 2 of the License, or (at your
12
- * option) any later version.
13
- */
1
+// SPDX-License-Identifier: GPL-2.0+
2
+//
3
+// wm1133-ev1.c - Audio for WM1133-EV1 on i.MX31ADS
4
+//
5
+// Copyright (c) 2010 Wolfson Microelectronics plc
6
+// Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7
+//
8
+// Based on an earlier driver for the same hardware by Liam Girdwood.
149
1510 #include <linux/platform_device.h>
1611 #include <linux/clk.h>
....@@ -80,9 +75,9 @@
8075 static int wm1133_ev1_hw_params(struct snd_pcm_substream *substream,
8176 struct snd_pcm_hw_params *params)
8277 {
83
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
84
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
85
- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
78
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
79
+ struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
80
+ struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
8681 int i, found = 0;
8782 snd_pcm_format_t format = params_format(params);
8883 unsigned int rate = params_rate(params);
....@@ -201,7 +196,7 @@
201196
202197 static int wm1133_ev1_init(struct snd_soc_pcm_runtime *rtd)
203198 {
204
- struct snd_soc_component *component = rtd->codec_dai->component;
199
+ struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
205200
206201 /* Headphone jack detection */
207202 snd_soc_card_jack_new(rtd->card, "Headphone", SND_JACK_HEADPHONE,
....@@ -221,18 +216,20 @@
221216 }
222217
223218
219
+SND_SOC_DAILINK_DEFS(ev1,
220
+ DAILINK_COMP_ARRAY(COMP_CPU("imx-ssi.0")),
221
+ DAILINK_COMP_ARRAY(COMP_CODEC("wm8350-codec.0-0x1a", "wm8350-hifi")),
222
+ DAILINK_COMP_ARRAY(COMP_PLATFORM("imx-ssi.0")));
223
+
224224 static struct snd_soc_dai_link wm1133_ev1_dai = {
225225 .name = "WM1133-EV1",
226226 .stream_name = "Audio",
227
- .cpu_dai_name = "imx-ssi.0",
228
- .codec_dai_name = "wm8350-hifi",
229
- .platform_name = "imx-ssi.0",
230
- .codec_name = "wm8350-codec.0-0x1a",
231227 .init = wm1133_ev1_init,
232228 .ops = &wm1133_ev1_ops,
233229 .symmetric_rates = 1,
234230 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
235231 SND_SOC_DAIFMT_CBM_CFM,
232
+ SND_SOC_DAILINK_REG(ev1),
236233 };
237234
238235 static struct snd_soc_card wm1133_ev1 = {