forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/pxa/pxa2xx-i2s.c
....@@ -1,14 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * pxa2xx-i2s.c -- ALSA Soc Audio Layer
34 *
45 * Copyright 2005 Wolfson Microelectronics PLC.
56 * Author: Liam Girdwood
67 * lrg@slimlogic.co.uk
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.
128 */
139
1410 #include <linux/init.h>
....@@ -99,13 +95,13 @@
9995 static int pxa2xx_i2s_startup(struct snd_pcm_substream *substream,
10096 struct snd_soc_dai *dai)
10197 {
102
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
103
- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
98
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
99
+ struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
104100
105101 if (IS_ERR(clk_i2s))
106102 return PTR_ERR(clk_i2s);
107103
108
- if (!cpu_dai->active)
104
+ if (!snd_soc_dai_active(cpu_dai))
109105 SACR0 = 0;
110106
111107 return 0;
....@@ -265,7 +261,7 @@
265261 }
266262
267263 #ifdef CONFIG_PM
268
-static int pxa2xx_i2s_suspend(struct snd_soc_dai *dai)
264
+static int pxa2xx_soc_pcm_suspend(struct snd_soc_component *component)
269265 {
270266 /* store registers */
271267 pxa_i2s.sacr0 = SACR0;
....@@ -279,7 +275,7 @@
279275 return 0;
280276 }
281277
282
-static int pxa2xx_i2s_resume(struct snd_soc_dai *dai)
278
+static int pxa2xx_soc_pcm_resume(struct snd_soc_component *component)
283279 {
284280 pxa_i2s_wait();
285281
....@@ -294,8 +290,8 @@
294290 }
295291
296292 #else
297
-#define pxa2xx_i2s_suspend NULL
298
-#define pxa2xx_i2s_resume NULL
293
+#define pxa2xx_soc_pcm_suspend NULL
294
+#define pxa2xx_soc_pcm_resume NULL
299295 #endif
300296
301297 static int pxa2xx_i2s_probe(struct snd_soc_dai *dai)
....@@ -346,8 +342,6 @@
346342 static struct snd_soc_dai_driver pxa_i2s_dai = {
347343 .probe = pxa2xx_i2s_probe,
348344 .remove = pxa2xx_i2s_remove,
349
- .suspend = pxa2xx_i2s_suspend,
350
- .resume = pxa2xx_i2s_resume,
351345 .playback = {
352346 .channels_min = 2,
353347 .channels_max = 2,
....@@ -364,9 +358,18 @@
364358
365359 static const struct snd_soc_component_driver pxa_i2s_component = {
366360 .name = "pxa-i2s",
367
- .ops = &pxa2xx_pcm_ops,
368
- .pcm_new = pxa2xx_soc_pcm_new,
369
- .pcm_free = pxa2xx_pcm_free_dma_buffers,
361
+ .pcm_construct = pxa2xx_soc_pcm_new,
362
+ .pcm_destruct = pxa2xx_soc_pcm_free,
363
+ .open = pxa2xx_soc_pcm_open,
364
+ .close = pxa2xx_soc_pcm_close,
365
+ .hw_params = pxa2xx_soc_pcm_hw_params,
366
+ .hw_free = pxa2xx_soc_pcm_hw_free,
367
+ .prepare = pxa2xx_soc_pcm_prepare,
368
+ .trigger = pxa2xx_soc_pcm_trigger,
369
+ .pointer = pxa2xx_soc_pcm_pointer,
370
+ .mmap = pxa2xx_soc_pcm_mmap,
371
+ .suspend = pxa2xx_soc_pcm_suspend,
372
+ .resume = pxa2xx_soc_pcm_resume,
370373 };
371374
372375 static int pxa2xx_i2s_drv_probe(struct platform_device *pdev)