forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/fsl/mx27vis-aic32x4.c
....@@ -1,25 +1,10 @@
1
-/*
2
- * mx27vis-aic32x4.c
3
- *
4
- * Copyright 2011 Vista Silicon S.L.
5
- *
6
- * Author: Javier Martin <javier.martin@vista-silicon.com>
7
- *
8
- * This program is free software; you can redistribute it and/or modify it
9
- * under the terms of the GNU General Public License as published by the
10
- * Free Software Foundation; either version 2 of the License, or (at your
11
- * option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program; if not, write to the Free Software
20
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21
- * MA 02110-1301, USA.
22
- */
1
+// SPDX-License-Identifier: GPL-2.0+
2
+//
3
+// mx27vis-aic32x4.c
4
+//
5
+// Copyright 2011 Vista Silicon S.L.
6
+//
7
+// Author: Javier Martin <javier.martin@vista-silicon.com>
238
249 #include <linux/module.h>
2510 #include <linux/moduleparam.h>
....@@ -51,9 +36,9 @@
5136 static int mx27vis_aic32x4_hw_params(struct snd_pcm_substream *substream,
5237 struct snd_pcm_hw_params *params)
5338 {
54
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
55
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
56
- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
39
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
40
+ struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
41
+ struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
5742 int ret;
5843
5944 ret = snd_soc_dai_set_sysclk(codec_dai, 0,
....@@ -147,16 +132,19 @@
147132 {"IN3_L", NULL, "Mic Bias"},
148133 };
149134
135
+SND_SOC_DAILINK_DEFS(hifi,
136
+ DAILINK_COMP_ARRAY(COMP_CPU("imx-ssi.0")),
137
+ DAILINK_COMP_ARRAY(COMP_CODEC("tlv320aic32x4.0-0018",
138
+ "tlv320aic32x4-hifi")),
139
+ DAILINK_COMP_ARRAY(COMP_PLATFORM("imx-ssi.0")));
140
+
150141 static struct snd_soc_dai_link mx27vis_aic32x4_dai = {
151142 .name = "tlv320aic32x4",
152143 .stream_name = "TLV320AIC32X4",
153
- .codec_dai_name = "tlv320aic32x4-hifi",
154
- .platform_name = "imx-ssi.0",
155
- .codec_name = "tlv320aic32x4.0-0018",
156
- .cpu_dai_name = "imx-ssi.0",
157144 .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_NB_NF |
158145 SND_SOC_DAIFMT_CBM_CFM,
159146 .ops = &mx27vis_aic32x4_snd_ops,
147
+ SND_SOC_DAILINK_REG(hifi),
160148 };
161149
162150 static struct snd_soc_card mx27vis_aic32x4 = {
....@@ -188,7 +176,7 @@
188176 mx27vis_amp_muter_gpio = pdata->amp_muter_gpio;
189177
190178 mx27vis_aic32x4.dev = &pdev->dev;
191
- ret = snd_soc_register_card(&mx27vis_aic32x4);
179
+ ret = devm_snd_soc_register_card(&pdev->dev, &mx27vis_aic32x4);
192180 if (ret) {
193181 dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n",
194182 ret);
....@@ -211,19 +199,11 @@
211199 return ret;
212200 }
213201
214
-static int mx27vis_aic32x4_remove(struct platform_device *pdev)
215
-{
216
- snd_soc_unregister_card(&mx27vis_aic32x4);
217
-
218
- return 0;
219
-}
220
-
221202 static struct platform_driver mx27vis_aic32x4_audio_driver = {
222203 .driver = {
223204 .name = "mx27vis",
224205 },
225206 .probe = mx27vis_aic32x4_probe,
226
- .remove = mx27vis_aic32x4_remove,
227207 };
228208
229209 module_platform_driver(mx27vis_aic32x4_audio_driver);