forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 1f93a7dfd1f8d5ff7a5c53246c7534fe2332d6f4
kernel/sound/soc/samsung/jive_wm8750.c
....@@ -1,15 +1,10 @@
1
-/* sound/soc/samsung/jive_wm8750.c
2
- *
3
- * Copyright 2007,2008 Simtec Electronics
4
- *
5
- * Based on sound/soc/pxa/spitz.c
6
- * Copyright 2005 Wolfson Microelectronics PLC.
7
- * Copyright 2005 Openedhand Ltd.
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
+// Copyright 2007,2008 Simtec Electronics
4
+//
5
+// Based on sound/soc/pxa/spitz.c
6
+// Copyright 2005 Wolfson Microelectronics PLC.
7
+// Copyright 2005 Openedhand Ltd.
138
149 #include <linux/module.h>
1510 #include <sound/soc.h>
....@@ -37,9 +32,9 @@
3732 static int jive_hw_params(struct snd_pcm_substream *substream,
3833 struct snd_pcm_hw_params *params)
3934 {
40
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
41
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
42
- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
35
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
36
+ struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
37
+ struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
4338 struct s3c_i2sv2_rate_calc div;
4439 unsigned int clk = 0;
4540 int ret = 0;
....@@ -83,16 +78,18 @@
8378 .hw_params = jive_hw_params,
8479 };
8580
81
+SND_SOC_DAILINK_DEFS(wm8750,
82
+ DAILINK_COMP_ARRAY(COMP_CPU("s3c2412-i2s")),
83
+ DAILINK_COMP_ARRAY(COMP_CODEC("wm8750.0-001a", "wm8750-hifi")),
84
+ DAILINK_COMP_ARRAY(COMP_PLATFORM("s3c2412-i2s")));
85
+
8686 static struct snd_soc_dai_link jive_dai = {
8787 .name = "wm8750",
8888 .stream_name = "WM8750",
89
- .cpu_dai_name = "s3c2412-i2s",
90
- .codec_dai_name = "wm8750-hifi",
91
- .platform_name = "s3c2412-i2s",
92
- .codec_name = "wm8750.0-001a",
9389 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
9490 SND_SOC_DAIFMT_CBS_CFS,
9591 .ops = &jive_ops,
92
+ SND_SOC_DAILINK_REG(wm8750),
9693 };
9794
9895 /* jive audio machine driver */