forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/pxa/imote2.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12
23 #include <linux/module.h>
34 #include <sound/soc.h>
....@@ -10,9 +11,9 @@
1011 static int imote2_asoc_hw_params(struct snd_pcm_substream *substream,
1112 struct snd_pcm_hw_params *params)
1213 {
13
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
14
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
15
- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
14
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
15
+ struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
16
+ struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
1617 unsigned int clk = 0;
1718 int ret;
1819
....@@ -46,16 +47,19 @@
4647 .hw_params = imote2_asoc_hw_params,
4748 };
4849
50
+SND_SOC_DAILINK_DEFS(wm8940,
51
+ DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-i2s")),
52
+ DAILINK_COMP_ARRAY(COMP_CODEC("wm8940-codec.0-0034",
53
+ "wm8940-hifi")),
54
+ DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
55
+
4956 static struct snd_soc_dai_link imote2_dai = {
5057 .name = "WM8940",
5158 .stream_name = "WM8940",
52
- .cpu_dai_name = "pxa2xx-i2s",
53
- .codec_dai_name = "wm8940-hifi",
54
- .platform_name = "pxa-pcm-audio",
55
- .codec_name = "wm8940-codec.0-0034",
5659 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
5760 SND_SOC_DAIFMT_CBS_CFS,
5861 .ops = &imote2_asoc_ops,
62
+ SND_SOC_DAILINK_REG(wm8940),
5963 };
6064
6165 static struct snd_soc_card imote2 = {