forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/samsung/smartq_wm8987.c
....@@ -1,17 +1,10 @@
1
-/* sound/soc/samsung/smartq_wm8987.c
2
- *
3
- * Copyright 2010 Maurus Cuelenaere <mcuelenaere@gmail.com>
4
- *
5
- * Based on smdk6410_wm8987.c
6
- * Copyright 2007 Wolfson Microelectronics PLC. - linux@wolfsonmicro.com
7
- * Graeme Gregory - graeme.gregory@wolfsonmicro.com
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
- *
14
- */
1
+// SPDX-License-Identifier: GPL-2.0+
2
+//
3
+// Copyright 2010 Maurus Cuelenaere <mcuelenaere@gmail.com>
4
+//
5
+// Based on smdk6410_wm8987.c
6
+// Copyright 2007 Wolfson Microelectronics PLC. - linux@wolfsonmicro.com
7
+// Graeme Gregory - graeme.gregory@wolfsonmicro.com
158
169 #include <linux/gpio/consumer.h>
1710 #include <linux/module.h>
....@@ -31,9 +24,9 @@
3124 static int smartq_hifi_hw_params(struct snd_pcm_substream *substream,
3225 struct snd_pcm_hw_params *params)
3326 {
34
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
35
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
36
- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
27
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
28
+ struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
29
+ struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
3730 unsigned int clk = 0;
3831 int ret;
3932
....@@ -160,18 +153,20 @@
160153 return err;
161154 }
162155
156
+SND_SOC_DAILINK_DEFS(wm8987,
157
+ DAILINK_COMP_ARRAY(COMP_CPU("samsung-i2s.0")),
158
+ DAILINK_COMP_ARRAY(COMP_CODEC("wm8750.0-0x1a", "wm8750-hifi")),
159
+ DAILINK_COMP_ARRAY(COMP_PLATFORM("samsung-i2s.0")));
160
+
163161 static struct snd_soc_dai_link smartq_dai[] = {
164162 {
165163 .name = "wm8987",
166164 .stream_name = "SmartQ Hi-Fi",
167
- .cpu_dai_name = "samsung-i2s.0",
168
- .codec_dai_name = "wm8750-hifi",
169
- .platform_name = "samsung-i2s.0",
170
- .codec_name = "wm8750.0-0x1a",
171165 .init = smartq_wm8987_init,
172166 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
173167 SND_SOC_DAIFMT_CBS_CFS,
174168 .ops = &smartq_hifi_ops,
169
+ SND_SOC_DAILINK_REG(wm8987),
175170 },
176171 };
177172