forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/samsung/pcm.c
....@@ -1,15 +1,10 @@
1
-/* sound/soc/samsung/pcm.c
2
- *
3
- * ALSA SoC Audio Layer - S3C PCM-Controller driver
4
- *
5
- * Copyright (c) 2009 Samsung Electronics Co. Ltd
6
- * Author: Jaswinder Singh <jassisinghbrar@gmail.com>
7
- * based upon I2S drivers by Ben Dooks.
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
+// ALSA SoC Audio Layer - S3C PCM-Controller driver
4
+//
5
+// Copyright (c) 2009 Samsung Electronics Co. Ltd
6
+// Author: Jaswinder Singh <jassisinghbrar@gmail.com>
7
+// based upon I2S drivers by Ben Dooks.
138
149 #include <linux/clk.h>
1510 #include <linux/io.h>
....@@ -109,8 +104,13 @@
109104
110105 /**
111106 * struct s3c_pcm_info - S3C PCM Controller information
107
+ * @lock: Spin lock
112108 * @dev: The parent device passed to use from the probe.
113109 * @regs: The pointer to the device register block.
110
+ * @sclk_per_fs: number of sclk per frame sync
111
+ * @idleclk: Whether to keep PCMSCLK enabled even when idle (no active xfer)
112
+ * @pclk: the PCLK_PCM (pcm) clock pointer
113
+ * @cclk: the SCLK_AUDIO (audio-bus) clock pointer
114114 * @dma_playback: DMA information for playback channel.
115115 * @dma_capture: DMA information for capture channel.
116116 */
....@@ -216,8 +216,8 @@
216216 static int s3c_pcm_trigger(struct snd_pcm_substream *substream, int cmd,
217217 struct snd_soc_dai *dai)
218218 {
219
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
220
- struct s3c_pcm_info *pcm = snd_soc_dai_get_drvdata(rtd->cpu_dai);
219
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
220
+ struct s3c_pcm_info *pcm = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
221221 unsigned long flags;
222222
223223 dev_dbg(pcm->dev, "Entered %s\n", __func__);
....@@ -260,8 +260,8 @@
260260 struct snd_pcm_hw_params *params,
261261 struct snd_soc_dai *socdai)
262262 {
263
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
264
- struct s3c_pcm_info *pcm = snd_soc_dai_get_drvdata(rtd->cpu_dai);
263
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
264
+ struct s3c_pcm_info *pcm = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
265265 void __iomem *regs = pcm->regs;
266266 struct clk *clk;
267267 int sclk_div, sync_div;
....@@ -553,7 +553,7 @@
553553 pcm->dma_playback = &s3c_pcm_stereo_out[pdev->id];
554554
555555 ret = samsung_asoc_dma_platform_register(&pdev->dev, filter,
556
- NULL, NULL);
556
+ NULL, NULL, NULL);
557557 if (ret) {
558558 dev_err(&pdev->dev, "failed to get register DMA: %d\n", ret);
559559 goto err_dis_pclk;