forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 1f93a7dfd1f8d5ff7a5c53246c7534fe2332d6f4
kernel/sound/soc/ux500/ux500_pcm.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 <asm/page.h>
....@@ -49,7 +46,7 @@
4946 static struct dma_chan *ux500_pcm_request_chan(struct snd_soc_pcm_runtime *rtd,
5047 struct snd_pcm_substream *substream)
5148 {
52
- struct snd_soc_dai *dai = rtd->cpu_dai;
49
+ struct snd_soc_dai *dai = asoc_rtd_to_cpu(rtd, 0);
5350 u16 per_data_width, mem_data_width;
5451 struct stedma40_chan_cfg *dma_cfg;
5552 struct ux500_msp_dma_params *dma_params;
....@@ -88,8 +85,8 @@
8885 struct snd_pcm_hw_params *params,
8986 struct dma_slave_config *slave_config)
9087 {
91
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
92
- struct msp_i2s_platform_data *pdata = rtd->cpu_dai->dev->platform_data;
88
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
89
+ struct msp_i2s_platform_data *pdata = asoc_rtd_to_cpu(rtd, 0)->dev->platform_data;
9390 struct snd_dmaengine_dai_dma_data *snd_dma_params;
9491 struct ux500_msp_dma_params *ste_dma_params;
9592 dma_addr_t dma_addr;
....@@ -97,11 +94,11 @@
9794
9895 if (pdata) {
9996 ste_dma_params =
100
- snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
97
+ snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
10198 dma_addr = ste_dma_params->tx_rx_addr;
10299 } else {
103100 snd_dma_params =
104
- snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
101
+ snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
105102 dma_addr = snd_dma_params->addr;
106103 }
107104