forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/sound/soc/pxa/brownstone.c
....@@ -1,13 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * linux/sound/soc/pxa/brownstone.c
34 *
45 * Copyright (C) 2011 Marvell International Ltd.
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version.
10
- *
116 */
127
138 #include <linux/module.h>
....@@ -48,9 +43,9 @@
4843 static int brownstone_wm8994_hw_params(struct snd_pcm_substream *substream,
4944 struct snd_pcm_hw_params *params)
5045 {
51
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
52
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
53
- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
46
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
47
+ struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
48
+ struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
5449 int freq_out, sspa_mclk, sysclk;
5550
5651 if (params_rate(params) > 11025) {
....@@ -78,17 +73,19 @@
7873 .hw_params = brownstone_wm8994_hw_params,
7974 };
8075
76
+SND_SOC_DAILINK_DEFS(wm8994,
77
+ DAILINK_COMP_ARRAY(COMP_CPU("mmp-sspa-dai.0")),
78
+ DAILINK_COMP_ARRAY(COMP_CODEC("wm8994-codec", "wm8994-aif1")),
79
+ DAILINK_COMP_ARRAY(COMP_PLATFORM("mmp-pcm-audio")));
80
+
8181 static struct snd_soc_dai_link brownstone_wm8994_dai[] = {
8282 {
8383 .name = "WM8994",
8484 .stream_name = "WM8994 HiFi",
85
- .cpu_dai_name = "mmp-sspa-dai.0",
86
- .codec_dai_name = "wm8994-aif1",
87
- .platform_name = "mmp-pcm-audio",
88
- .codec_name = "wm8994-codec",
8985 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
9086 SND_SOC_DAIFMT_CBS_CFS,
9187 .ops = &brownstone_ops,
88
+ SND_SOC_DAILINK_REG(wm8994),
9289 },
9390 };
9491