1 // SPDX-License-Identifier: GPL-2.0-only
3 * soc-apci-intel-tgl-match.c - tables and support for ICL ACPI enumeration.
5 * Copyright (c) 2019, Intel Corporation.
9 #include <sound/soc-acpi.h>
10 #include <sound/soc-acpi-intel-match.h>
12 static const struct snd_soc_acpi_codecs tgl_codecs
= {
14 .codecs
= {"MX98357A"}
17 static const struct snd_soc_acpi_endpoint single_endpoint
= {
24 static const struct snd_soc_acpi_endpoint spk_l_endpoint
= {
31 static const struct snd_soc_acpi_endpoint spk_r_endpoint
= {
38 static const struct snd_soc_acpi_adr_device rt711_0_adr
[] = {
40 .adr
= 0x000020025D071100,
42 .endpoints
= &single_endpoint
,
43 .name_prefix
= "rt711"
47 static const struct snd_soc_acpi_adr_device rt711_1_adr
[] = {
49 .adr
= 0x000120025D071100,
51 .endpoints
= &single_endpoint
,
52 .name_prefix
= "rt711"
56 static const struct snd_soc_acpi_adr_device rt1308_1_dual_adr
[] = {
58 .adr
= 0x000120025D130800,
60 .endpoints
= &spk_l_endpoint
,
61 .name_prefix
= "rt1308-1"
64 .adr
= 0x000122025D130800,
66 .endpoints
= &spk_r_endpoint
,
67 .name_prefix
= "rt1308-2"
71 static const struct snd_soc_acpi_adr_device rt1308_1_single_adr
[] = {
73 .adr
= 0x000120025D130800,
75 .endpoints
= &single_endpoint
,
76 .name_prefix
= "rt1308-1"
80 static const struct snd_soc_acpi_adr_device rt1308_2_single_adr
[] = {
82 .adr
= 0x000220025D130800,
84 .endpoints
= &single_endpoint
,
85 .name_prefix
= "rt1308-1"
89 static const struct snd_soc_acpi_adr_device rt1308_1_group1_adr
[] = {
91 .adr
= 0x000120025D130800,
93 .endpoints
= &spk_l_endpoint
,
94 .name_prefix
= "rt1308-1"
98 static const struct snd_soc_acpi_adr_device rt1308_2_group1_adr
[] = {
100 .adr
= 0x000220025D130800,
102 .endpoints
= &spk_r_endpoint
,
103 .name_prefix
= "rt1308-2"
107 static const struct snd_soc_acpi_adr_device rt715_0_adr
[] = {
109 .adr
= 0x000021025D071500,
111 .endpoints
= &single_endpoint
,
112 .name_prefix
= "rt715"
116 static const struct snd_soc_acpi_adr_device rt715_3_adr
[] = {
118 .adr
= 0x000320025D071500,
120 .endpoints
= &single_endpoint
,
121 .name_prefix
= "rt715"
125 static const struct snd_soc_acpi_adr_device mx8373_1_adr
[] = {
127 .adr
= 0x000123019F837300,
129 .endpoints
= &spk_l_endpoint
,
130 .name_prefix
= "Right"
133 .adr
= 0x000127019F837300,
135 .endpoints
= &spk_r_endpoint
,
136 .name_prefix
= "Left"
140 static const struct snd_soc_acpi_adr_device rt5682_0_adr
[] = {
142 .adr
= 0x000021025D568200,
144 .endpoints
= &single_endpoint
,
145 .name_prefix
= "rt5682"
149 static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr
[] = {
151 .adr
= 0x000030025D071101,
153 .endpoints
= &single_endpoint
,
154 .name_prefix
= "rt711"
158 static const struct snd_soc_acpi_adr_device rt1316_1_group1_adr
[] = {
160 .adr
= 0x000131025D131601, /* unique ID is set for some reason */
162 .endpoints
= &spk_l_endpoint
,
163 .name_prefix
= "rt1316-1"
167 static const struct snd_soc_acpi_adr_device rt1316_2_group1_adr
[] = {
169 .adr
= 0x000230025D131601,
171 .endpoints
= &spk_r_endpoint
,
172 .name_prefix
= "rt1316-2"
176 static const struct snd_soc_acpi_adr_device rt714_3_adr
[] = {
178 .adr
= 0x000330025D071401,
180 .endpoints
= &single_endpoint
,
181 .name_prefix
= "rt714"
185 static const struct snd_soc_acpi_link_adr tgl_i2s_rt1308
[] = {
188 .num_adr
= ARRAY_SIZE(rt711_0_adr
),
189 .adr_d
= rt711_0_adr
,
194 static const struct snd_soc_acpi_link_adr tgl_rvp
[] = {
197 .num_adr
= ARRAY_SIZE(rt711_0_adr
),
198 .adr_d
= rt711_0_adr
,
202 .num_adr
= ARRAY_SIZE(rt1308_1_dual_adr
),
203 .adr_d
= rt1308_1_dual_adr
,
208 static const struct snd_soc_acpi_link_adr tgl_chromebook_base
[] = {
211 .num_adr
= ARRAY_SIZE(rt5682_0_adr
),
212 .adr_d
= rt5682_0_adr
,
216 .num_adr
= ARRAY_SIZE(mx8373_1_adr
),
217 .adr_d
= mx8373_1_adr
,
222 static const struct snd_soc_acpi_link_adr tgl_3_in_1_default
[] = {
225 .num_adr
= ARRAY_SIZE(rt711_0_adr
),
226 .adr_d
= rt711_0_adr
,
230 .num_adr
= ARRAY_SIZE(rt1308_1_group1_adr
),
231 .adr_d
= rt1308_1_group1_adr
,
235 .num_adr
= ARRAY_SIZE(rt1308_2_group1_adr
),
236 .adr_d
= rt1308_2_group1_adr
,
240 .num_adr
= ARRAY_SIZE(rt715_3_adr
),
241 .adr_d
= rt715_3_adr
,
246 static const struct snd_soc_acpi_link_adr tgl_3_in_1_mono_amp
[] = {
249 .num_adr
= ARRAY_SIZE(rt711_0_adr
),
250 .adr_d
= rt711_0_adr
,
254 .num_adr
= ARRAY_SIZE(rt1308_1_single_adr
),
255 .adr_d
= rt1308_1_single_adr
,
259 .num_adr
= ARRAY_SIZE(rt715_3_adr
),
260 .adr_d
= rt715_3_adr
,
265 static const struct snd_soc_acpi_link_adr tgl_sdw_rt711_link1_rt1308_link2_rt715_link0
[] = {
268 .num_adr
= ARRAY_SIZE(rt711_1_adr
),
269 .adr_d
= rt711_1_adr
,
273 .num_adr
= ARRAY_SIZE(rt1308_2_single_adr
),
274 .adr_d
= rt1308_2_single_adr
,
278 .num_adr
= ARRAY_SIZE(rt715_0_adr
),
279 .adr_d
= rt715_0_adr
,
284 static const struct snd_soc_acpi_link_adr tgl_3_in_1_sdca
[] = {
287 .num_adr
= ARRAY_SIZE(rt711_sdca_0_adr
),
288 .adr_d
= rt711_sdca_0_adr
,
292 .num_adr
= ARRAY_SIZE(rt1316_1_group1_adr
),
293 .adr_d
= rt1316_1_group1_adr
,
297 .num_adr
= ARRAY_SIZE(rt1316_2_group1_adr
),
298 .adr_d
= rt1316_2_group1_adr
,
302 .num_adr
= ARRAY_SIZE(rt714_3_adr
),
303 .adr_d
= rt714_3_adr
,
308 static const struct snd_soc_acpi_codecs tgl_max98373_amp
= {
310 .codecs
= {"MX98373"}
313 static const struct snd_soc_acpi_codecs tgl_rt1011_amp
= {
315 .codecs
= {"10EC1011"}
318 struct snd_soc_acpi_mach snd_soc_acpi_intel_tgl_machines
[] = {
321 .drv_name
= "sof_sdw",
322 .link_mask
= 0x1, /* RT711 on SoundWire link0 */
323 .links
= tgl_i2s_rt1308
,
324 .sof_fw_filename
= "sof-tgl.ri",
325 .sof_tplg_filename
= "sof-tgl-rt711-i2s-rt1308.tplg",
329 .drv_name
= "tgl_max98357a_rt5682",
330 .machine_quirk
= snd_soc_acpi_codec_list
,
331 .quirk_data
= &tgl_codecs
,
332 .sof_fw_filename
= "sof-tgl.ri",
333 .sof_tplg_filename
= "sof-tgl-max98357a-rt5682.tplg",
337 .drv_name
= "tgl_max98373_rt5682",
338 .machine_quirk
= snd_soc_acpi_codec_list
,
339 .quirk_data
= &tgl_max98373_amp
,
340 .sof_fw_filename
= "sof-tgl.ri",
341 .sof_tplg_filename
= "sof-tgl-max98373-rt5682.tplg",
345 .drv_name
= "tgl_rt1011_rt5682",
346 .machine_quirk
= snd_soc_acpi_codec_list
,
347 .quirk_data
= &tgl_rt1011_amp
,
348 .sof_fw_filename
= "sof-tgl.ri",
349 .sof_tplg_filename
= "sof-tgl-rt1011-rt5682.tplg",
353 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_tgl_machines
);
355 /* this table is used when there is no I2S codec present */
356 struct snd_soc_acpi_mach snd_soc_acpi_intel_tgl_sdw_machines
[] = {
359 .links
= tgl_sdw_rt711_link1_rt1308_link2_rt715_link0
,
360 .drv_name
= "sof_sdw",
361 .sof_fw_filename
= "sof-tgl.ri",
362 .sof_tplg_filename
= "sof-tgl-rt715-rt711-rt1308-mono.tplg",
365 .link_mask
= 0xF, /* 4 active links required */
366 .links
= tgl_3_in_1_default
,
367 .drv_name
= "sof_sdw",
368 .sof_fw_filename
= "sof-tgl.ri",
369 .sof_tplg_filename
= "sof-tgl-rt711-rt1308-rt715.tplg",
373 * link_mask should be 0xB, but all links are enabled by BIOS.
374 * This entry will be selected if there is no rt1308 exposed
375 * on link2 since it will fail to match the above entry.
378 .links
= tgl_3_in_1_mono_amp
,
379 .drv_name
= "sof_sdw",
380 .sof_fw_filename
= "sof-tgl.ri",
381 .sof_tplg_filename
= "sof-tgl-rt711-rt1308-mono-rt715.tplg",
384 .link_mask
= 0xF, /* 4 active links required */
385 .links
= tgl_3_in_1_sdca
,
386 .drv_name
= "sof_sdw",
387 .sof_fw_filename
= "sof-tgl.ri",
388 .sof_tplg_filename
= "sof-tgl-rt711-rt1316-rt714.tplg",
391 .link_mask
= 0x3, /* rt711 on link 0 and 2 rt1308s on link 1 */
393 .drv_name
= "sof_sdw",
394 .sof_fw_filename
= "sof-tgl.ri",
395 .sof_tplg_filename
= "sof-tgl-rt711-rt1308.tplg",
398 .link_mask
= 0x3, /* rt5682 on link0 & 2xmax98373 on link 1 */
399 .links
= tgl_chromebook_base
,
400 .drv_name
= "sof_sdw",
401 .sof_fw_filename
= "sof-tgl.ri",
402 .sof_tplg_filename
= "sof-tgl-sdw-max98373-rt5682.tplg",
405 .link_mask
= 0x1, /* this will only enable rt5682 for now */
406 .links
= tgl_chromebook_base
,
407 .drv_name
= "sof_sdw",
408 .sof_fw_filename
= "sof-tgl.ri",
409 .sof_tplg_filename
= "sof-tgl-rt5682.tplg",
413 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_tgl_sdw_machines
);
415 MODULE_LICENSE("GPL v2");
416 MODULE_DESCRIPTION("Intel Common ACPI Match module");