hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/sound/soc/intel/boards/bytcht_nocodec.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * bytcht_nocodec.c - ASoc Machine driver for MinnowBoard Max and Up
34 * to make I2S signals observable on the Low-Speed connector. Audio codec
....@@ -6,15 +7,6 @@
67 * Copyright (C) 2015-2017 Intel Corp
78 *
89 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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 as published by
12
- * the Free Software Foundation; version 2 of the License.
13
- *
14
- * This program is distributed in the hope that it will be useful, but
15
- * WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
- * General Public License for more details.
1810 *
1911 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2012 */
....@@ -66,7 +58,7 @@
6658 * with explicit setting to I2S 2ch 24-bit. The word length is set with
6759 * dai_set_tdm_slot() since there is no other API exposed
6860 */
69
- ret = snd_soc_dai_set_fmt(rtd->cpu_dai,
61
+ ret = snd_soc_dai_set_fmt(asoc_rtd_to_cpu(rtd, 0),
7062 SND_SOC_DAIFMT_I2S |
7163 SND_SOC_DAIFMT_NB_NF |
7264 SND_SOC_DAIFMT_CBS_CFS);
....@@ -76,7 +68,7 @@
7668 return ret;
7769 }
7870
79
- ret = snd_soc_dai_set_tdm_slot(rtd->cpu_dai, 0x3, 0x3, 2, 24);
71
+ ret = snd_soc_dai_set_tdm_slot(asoc_rtd_to_cpu(rtd, 0), 0x3, 0x3, 2, 24);
8072 if (ret < 0) {
8173 dev_err(rtd->dev, "can't set I2S config, err %d\n", ret);
8274 return ret;
....@@ -105,44 +97,49 @@
10597 .startup = aif1_startup,
10698 };
10799
100
+SND_SOC_DAILINK_DEF(dummy,
101
+ DAILINK_COMP_ARRAY(COMP_DUMMY()));
102
+
103
+SND_SOC_DAILINK_DEF(media,
104
+ DAILINK_COMP_ARRAY(COMP_CPU("media-cpu-dai")));
105
+
106
+SND_SOC_DAILINK_DEF(deepbuffer,
107
+ DAILINK_COMP_ARRAY(COMP_CPU("deepbuffer-cpu-dai")));
108
+
109
+SND_SOC_DAILINK_DEF(ssp2_port,
110
+ DAILINK_COMP_ARRAY(COMP_CPU("ssp2-port")));
111
+
112
+SND_SOC_DAILINK_DEF(platform,
113
+ DAILINK_COMP_ARRAY(COMP_PLATFORM("sst-mfld-platform")));
114
+
108115 static struct snd_soc_dai_link dais[] = {
109116 [MERR_DPCM_AUDIO] = {
110117 .name = "Audio Port",
111118 .stream_name = "Audio",
112
- .cpu_dai_name = "media-cpu-dai",
113
- .codec_dai_name = "snd-soc-dummy-dai",
114
- .codec_name = "snd-soc-dummy",
115
- .platform_name = "sst-mfld-platform",
116119 .ignore_suspend = 1,
117120 .nonatomic = true,
118121 .dynamic = 1,
119122 .dpcm_playback = 1,
120123 .dpcm_capture = 1,
121124 .ops = &aif1_ops,
125
+ SND_SOC_DAILINK_REG(media, dummy, platform),
122126 },
123127 [MERR_DPCM_DEEP_BUFFER] = {
124128 .name = "Deep-Buffer Audio Port",
125129 .stream_name = "Deep-Buffer Audio",
126
- .cpu_dai_name = "deepbuffer-cpu-dai",
127
- .codec_dai_name = "snd-soc-dummy-dai",
128
- .codec_name = "snd-soc-dummy",
129
- .platform_name = "sst-mfld-platform",
130130 .ignore_suspend = 1,
131131 .nonatomic = true,
132132 .dynamic = 1,
133133 .dpcm_playback = 1,
134134 .ops = &aif1_ops,
135
+ SND_SOC_DAILINK_REG(deepbuffer, dummy, platform),
135136 },
136137 /* CODEC<->CODEC link */
137138 /* back ends */
138139 {
139140 .name = "SSP2-LowSpeed Connector",
140141 .id = 0,
141
- .cpu_dai_name = "ssp2-port",
142
- .platform_name = "sst-mfld-platform",
143142 .no_pcm = 1,
144
- .codec_dai_name = "snd-soc-dummy-dai",
145
- .codec_name = "snd-soc-dummy",
146143 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
147144 | SND_SOC_DAIFMT_CBS_CFS,
148145 .be_hw_params_fixup = codec_fixup,
....@@ -150,6 +147,7 @@
150147 .nonatomic = true,
151148 .dpcm_playback = 1,
152149 .dpcm_capture = 1,
150
+ SND_SOC_DAILINK_REG(ssp2_port, dummy, platform),
153151 },
154152 };
155153