forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/samsung/s3c24xx_uda134x.c
....@@ -1,15 +1,11 @@
1
-/*
2
- * Modifications by Christian Pellegrin <chripell@evolware.org>
3
- *
4
- * s3c24xx_uda134x.c -- S3C24XX_UDA134X ALSA SoC Audio board driver
5
- *
6
- * Copyright 2007 Dension Audio Systems Ltd.
7
- * Author: Zoltan Devai
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.
12
- */
1
+// SPDX-License-Identifier: GPL-2.0
2
+//
3
+// Modifications by Christian Pellegrin <chripell@evolware.org>
4
+//
5
+// s3c24xx_uda134x.c - S3C24XX_UDA134X ALSA SoC Audio board driver
6
+//
7
+// Copyright 2007 Dension Audio Systems Ltd.
8
+// Author: Zoltan Devai
139
1410 #include <linux/clk.h>
1511 #include <linux/gpio.h>
....@@ -53,9 +49,9 @@
5349
5450 static int s3c24xx_uda134x_startup(struct snd_pcm_substream *substream)
5551 {
56
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
52
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
5753 struct s3c24xx_uda134x *priv = snd_soc_card_get_drvdata(rtd->card);
58
- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
54
+ struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
5955 int ret = 0;
6056
6157 mutex_lock(&priv->clk_lock);
....@@ -105,7 +101,7 @@
105101
106102 static void s3c24xx_uda134x_shutdown(struct snd_pcm_substream *substream)
107103 {
108
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
104
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
109105 struct s3c24xx_uda134x *priv = snd_soc_card_get_drvdata(rtd->card);
110106
111107 mutex_lock(&priv->clk_lock);
....@@ -122,9 +118,9 @@
122118 static int s3c24xx_uda134x_hw_params(struct snd_pcm_substream *substream,
123119 struct snd_pcm_hw_params *params)
124120 {
125
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
126
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
127
- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
121
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
122
+ struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
123
+ struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
128124 unsigned int clk = 0;
129125 int ret = 0;
130126 int clk_source, fs_mode;
....@@ -205,16 +201,18 @@
205201 .hw_params = s3c24xx_uda134x_hw_params,
206202 };
207203
204
+SND_SOC_DAILINK_DEFS(uda134x,
205
+ DAILINK_COMP_ARRAY(COMP_CPU("s3c24xx-iis")),
206
+ DAILINK_COMP_ARRAY(COMP_CODEC("uda134x-codec", "uda134x-hifi")),
207
+ DAILINK_COMP_ARRAY(COMP_PLATFORM("s3c24xx-iis")));
208
+
208209 static struct snd_soc_dai_link s3c24xx_uda134x_dai_link = {
209210 .name = "UDA134X",
210211 .stream_name = "UDA134X",
211
- .codec_name = "uda134x-codec",
212
- .codec_dai_name = "uda134x-hifi",
213
- .cpu_dai_name = "s3c24xx-iis",
214212 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
215213 SND_SOC_DAIFMT_CBS_CFS,
216214 .ops = &s3c24xx_uda134x_ops,
217
- .platform_name = "s3c24xx-iis",
215
+ SND_SOC_DAILINK_REG(uda134x),
218216 };
219217
220218 static struct snd_soc_card snd_soc_s3c24xx_uda134x = {