forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 1f93a7dfd1f8d5ff7a5c53246c7534fe2332d6f4
kernel/sound/soc/ux500/mop500_ab8500.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) ST-Ericsson SA 2012
34 *
....@@ -6,10 +7,6 @@
67 * for ST-Ericsson.
78 *
89 * License terms:
9
- *
10
- * This program is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License version 2 as published
12
- * by the Free Software Foundation.
1310 */
1411
1512 #include <linux/module.h>
....@@ -193,7 +190,7 @@
193190
194191 static int mop500_ab8500_startup(struct snd_pcm_substream *substream)
195192 {
196
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
193
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
197194
198195 /* Set audio-clock source */
199196 return mop500_ab8500_set_mclk(rtd->card->dev,
....@@ -202,7 +199,7 @@
202199
203200 static void mop500_ab8500_shutdown(struct snd_pcm_substream *substream)
204201 {
205
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
202
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
206203 struct device *dev = rtd->card->dev;
207204
208205 dev_dbg(dev, "%s: Enter\n", __func__);
....@@ -217,9 +214,9 @@
217214 static int mop500_ab8500_hw_params(struct snd_pcm_substream *substream,
218215 struct snd_pcm_hw_params *params)
219216 {
220
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
221
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
222
- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
217
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
218
+ struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
219
+ struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
223220 struct device *dev = rtd->card->dev;
224221 unsigned int fmt;
225222 int channels, ret = 0, driver_mode, slots;
....@@ -341,8 +338,8 @@
341338
342339 static int mop500_ab8500_hw_free(struct snd_pcm_substream *substream)
343340 {
344
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
345
- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
341
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
342
+ struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
346343
347344 mutex_lock(&mop500_ab8500_params_lock);
348345 __clear_bit(cpu_dai->id, &mop500_ab8500_usage);