1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * soc-acpi-intel-lnl-match.c - tables and support for LNL ACPI enumeration.
4 *
5 * Copyright (c) 2023, Intel Corporation. All rights reserved.
6 *
7 */
8
9#include <sound/soc-acpi.h>
10#include <sound/soc-acpi-intel-match.h>
11#include "soc-acpi-intel-sdw-mockup-match.h"
12
13struct snd_soc_acpi_mach snd_soc_acpi_intel_lnl_machines[] = {
14 {},
15};
16EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_lnl_machines);
17
18static const struct snd_soc_acpi_endpoint single_endpoint = {
19 .num = 0,
20 .aggregated = 0,
21 .group_position = 0,
22 .group_id = 0,
23};
24
25static const struct snd_soc_acpi_endpoint spk_l_endpoint = {
26 .num = 0,
27 .aggregated = 1,
28 .group_position = 0,
29 .group_id = 1,
30};
31
32static const struct snd_soc_acpi_endpoint spk_r_endpoint = {
33 .num = 0,
34 .aggregated = 1,
35 .group_position = 1,
36 .group_id = 1,
37};
38
39static const struct snd_soc_acpi_endpoint rt712_endpoints[] = {
40 {
41 .num = 0,
42 .aggregated = 0,
43 .group_position = 0,
44 .group_id = 0,
45 },
46 {
47 .num = 1,
48 .aggregated = 0,
49 .group_position = 0,
50 .group_id = 0,
51 },
52};
53
54/*
55 * RT722 is a multi-function codec, three endpoints are created for
56 * its headset, amp and dmic functions.
57 */
58static const struct snd_soc_acpi_endpoint rt722_endpoints[] = {
59 {
60 .num = 0,
61 .aggregated = 0,
62 .group_position = 0,
63 .group_id = 0,
64 },
65 {
66 .num = 1,
67 .aggregated = 0,
68 .group_position = 0,
69 .group_id = 0,
70 },
71 {
72 .num = 2,
73 .aggregated = 0,
74 .group_position = 0,
75 .group_id = 0,
76 },
77};
78
79static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = {
80 {
81 .adr = 0x000030025D071101ull,
82 .num_endpoints = 1,
83 .endpoints = &single_endpoint,
84 .name_prefix = "rt711"
85 }
86};
87
88static const struct snd_soc_acpi_adr_device rt712_2_single_adr[] = {
89 {
90 .adr = 0x000230025D071201ull,
91 .num_endpoints = ARRAY_SIZE(rt712_endpoints),
92 .endpoints = rt712_endpoints,
93 .name_prefix = "rt712"
94 }
95};
96
97static const struct snd_soc_acpi_adr_device rt1712_3_single_adr[] = {
98 {
99 .adr = 0x000330025D171201ull,
100 .num_endpoints = 1,
101 .endpoints = &single_endpoint,
102 .name_prefix = "rt712-dmic"
103 }
104};
105
106static const struct snd_soc_acpi_adr_device rt722_0_single_adr[] = {
107 {
108 .adr = 0x000030025d072201ull,
109 .num_endpoints = ARRAY_SIZE(rt722_endpoints),
110 .endpoints = rt722_endpoints,
111 .name_prefix = "rt722"
112 }
113};
114
115static const struct snd_soc_acpi_adr_device rt1316_2_group1_adr[] = {
116 {
117 .adr = 0x000230025D131601ull,
118 .num_endpoints = 1,
119 .endpoints = &spk_l_endpoint,
120 .name_prefix = "rt1316-1"
121 }
122};
123
124static const struct snd_soc_acpi_adr_device rt1316_3_group1_adr[] = {
125 {
126 .adr = 0x000331025D131601ull,
127 .num_endpoints = 1,
128 .endpoints = &spk_r_endpoint,
129 .name_prefix = "rt1316-2"
130 }
131};
132
133static const struct snd_soc_acpi_adr_device rt714_1_adr[] = {
134 {
135 .adr = 0x000130025D071401ull,
136 .num_endpoints = 1,
137 .endpoints = &single_endpoint,
138 .name_prefix = "rt714"
139 }
140};
141
142static const struct snd_soc_acpi_link_adr lnl_rvp[] = {
143 {
144 .mask = BIT(0),
145 .num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
146 .adr_d = rt711_sdca_0_adr,
147 },
148 {}
149};
150
151static const struct snd_soc_acpi_link_adr lnl_712_only[] = {
152 {
153 .mask = BIT(2),
154 .num_adr = ARRAY_SIZE(rt712_2_single_adr),
155 .adr_d = rt712_2_single_adr,
156 },
157 {
158 .mask = BIT(3),
159 .num_adr = ARRAY_SIZE(rt1712_3_single_adr),
160 .adr_d = rt1712_3_single_adr,
161 },
162 {}
163};
164
165static const struct snd_soc_acpi_link_adr lnl_rt722_only[] = {
166 {
167 .mask = BIT(0),
168 .num_adr = ARRAY_SIZE(rt722_0_single_adr),
169 .adr_d = rt722_0_single_adr,
170 },
171 {}
172};
173
174static const struct snd_soc_acpi_link_adr lnl_3_in_1_sdca[] = {
175 {
176 .mask = BIT(0),
177 .num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
178 .adr_d = rt711_sdca_0_adr,
179 },
180 {
181 .mask = BIT(2),
182 .num_adr = ARRAY_SIZE(rt1316_2_group1_adr),
183 .adr_d = rt1316_2_group1_adr,
184 },
185 {
186 .mask = BIT(3),
187 .num_adr = ARRAY_SIZE(rt1316_3_group1_adr),
188 .adr_d = rt1316_3_group1_adr,
189 },
190 {
191 .mask = BIT(1),
192 .num_adr = ARRAY_SIZE(rt714_1_adr),
193 .adr_d = rt714_1_adr,
194 },
195 {}
196};
197
198/* this table is used when there is no I2S codec present */
199struct snd_soc_acpi_mach snd_soc_acpi_intel_lnl_sdw_machines[] = {
200 /* mockup tests need to be first */
201 {
202 .link_mask = GENMASK(3, 0),
203 .links = sdw_mockup_headset_2amps_mic,
204 .drv_name = "sof_sdw",
205 .sof_tplg_filename = "sof-lnl-rt711-rt1308-rt715.tplg",
206 },
207 {
208 .link_mask = BIT(0) | BIT(1) | BIT(3),
209 .links = sdw_mockup_headset_1amp_mic,
210 .drv_name = "sof_sdw",
211 .sof_tplg_filename = "sof-lnl-rt711-rt1308-mono-rt715.tplg",
212 },
213 {
214 .link_mask = GENMASK(2, 0),
215 .links = sdw_mockup_mic_headset_1amp,
216 .drv_name = "sof_sdw",
217 .sof_tplg_filename = "sof-lnl-rt715-rt711-rt1308-mono.tplg",
218 },
219 {
220 .link_mask = GENMASK(3, 0),
221 .links = lnl_3_in_1_sdca,
222 .drv_name = "sof_sdw",
223 .sof_tplg_filename = "sof-lnl-rt711-l0-rt1316-l23-rt714-l1.tplg",
224 },
225 {
226 .link_mask = BIT(0),
227 .links = lnl_rvp,
228 .drv_name = "sof_sdw",
229 .sof_tplg_filename = "sof-lnl-rt711.tplg",
230 },
231 {
232 .link_mask = BIT(2) | BIT(3),
233 .links = lnl_712_only,
234 .drv_name = "sof_sdw",
235 .sof_tplg_filename = "sof-lnl-rt712-l2-rt1712-l3.tplg",
236 },
237 {
238 .link_mask = BIT(0),
239 .links = lnl_rt722_only,
240 .drv_name = "sof_sdw",
241 .sof_tplg_filename = "sof-lnl-rt722-l0.tplg",
242 },
243 {},
244};
245EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_lnl_sdw_machines);
246

source code of linux/sound/soc/intel/common/soc-acpi-intel-lnl-match.c