1 // SPDX-License-Identifier: GPL-2.0-only
3 * soc-acpi-intel-mtl-match.c - tables and support for MTL ACPI enumeration.
5 * Copyright (c) 2022, Intel Corporation.
9 #include <sound/soc-acpi.h>
10 #include <sound/soc-acpi-intel-match.h>
11 #include "soc-acpi-intel-sdw-mockup-match.h"
13 static const struct snd_soc_acpi_codecs mtl_max98357a_amp = {
15 .codecs = {"MX98357A"}
18 static const struct snd_soc_acpi_codecs mtl_max98360a_amp = {
20 .codecs = {"MX98360A"}
23 static const struct snd_soc_acpi_codecs mtl_rt1019p_amp = {
28 static const struct snd_soc_acpi_codecs mtl_rt5682_rt5682s_hp = {
30 .codecs = {"10EC5682", "RTL5682"},
33 struct snd_soc_acpi_mach snd_soc_acpi_intel_mtl_machines[] = {
35 .comp_ids = &mtl_rt5682_rt5682s_hp,
36 .drv_name = "mtl_mx98357_rt5682",
37 .machine_quirk = snd_soc_acpi_codec_list,
38 .quirk_data = &mtl_max98357a_amp,
39 .sof_tplg_filename = "sof-mtl-max98357a-rt5682.tplg",
42 .comp_ids = &mtl_rt5682_rt5682s_hp,
43 .drv_name = "mtl_mx98360_rt5682",
44 .machine_quirk = snd_soc_acpi_codec_list,
45 .quirk_data = &mtl_max98360a_amp,
46 .sof_tplg_filename = "sof-mtl-max98360a-rt5682.tplg",
49 .comp_ids = &mtl_rt5682_rt5682s_hp,
50 .drv_name = "mtl_rt1019_rt5682",
51 .machine_quirk = snd_soc_acpi_codec_list,
52 .quirk_data = &mtl_rt1019p_amp,
53 .sof_tplg_filename = "sof-mtl-rt1019-rt5682.tplg",
57 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_mtl_machines);
59 static const struct snd_soc_acpi_endpoint single_endpoint = {
66 static const struct snd_soc_acpi_endpoint spk_l_endpoint = {
73 static const struct snd_soc_acpi_endpoint spk_r_endpoint = {
80 static const struct snd_soc_acpi_endpoint rt712_endpoints[] = {
95 static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = {
97 .adr = 0x000030025D071101ull,
99 .endpoints = &single_endpoint,
100 .name_prefix = "rt711"
104 static const struct snd_soc_acpi_adr_device rt712_0_single_adr[] = {
106 .adr = 0x000030025D071201ull,
107 .num_endpoints = ARRAY_SIZE(rt712_endpoints),
108 .endpoints = rt712_endpoints,
109 .name_prefix = "rt712"
113 static const struct snd_soc_acpi_adr_device rt1712_3_single_adr[] = {
115 .adr = 0x000330025D171201ull,
117 .endpoints = &single_endpoint,
118 .name_prefix = "rt712-dmic"
122 static const struct snd_soc_acpi_adr_device mx8373_0_adr[] = {
124 .adr = 0x000023019F837300ull,
126 .endpoints = &spk_l_endpoint,
127 .name_prefix = "Left"
130 .adr = 0x000027019F837300ull,
132 .endpoints = &spk_r_endpoint,
133 .name_prefix = "Right"
137 static const struct snd_soc_acpi_adr_device rt5682_2_adr[] = {
139 .adr = 0x000221025D568200ull,
141 .endpoints = &single_endpoint,
142 .name_prefix = "rt5682"
146 static const struct snd_soc_acpi_adr_device rt1316_2_group1_adr[] = {
148 .adr = 0x000230025D131601ull,
150 .endpoints = &spk_l_endpoint,
151 .name_prefix = "rt1316-1"
155 static const struct snd_soc_acpi_adr_device rt1316_3_group1_adr[] = {
157 .adr = 0x000331025D131601ull,
159 .endpoints = &spk_r_endpoint,
160 .name_prefix = "rt1316-2"
164 static const struct snd_soc_acpi_adr_device rt1318_1_group1_adr[] = {
166 .adr = 0x000130025D131801ull,
168 .endpoints = &spk_l_endpoint,
169 .name_prefix = "rt1318-1"
173 static const struct snd_soc_acpi_adr_device rt1318_2_group1_adr[] = {
175 .adr = 0x000232025D131801ull,
177 .endpoints = &spk_r_endpoint,
178 .name_prefix = "rt1318-2"
182 static const struct snd_soc_acpi_adr_device rt714_0_adr[] = {
184 .adr = 0x000030025D071401ull,
186 .endpoints = &single_endpoint,
187 .name_prefix = "rt714"
191 static const struct snd_soc_acpi_adr_device rt714_1_adr[] = {
193 .adr = 0x000130025D071401ull,
195 .endpoints = &single_endpoint,
196 .name_prefix = "rt714"
200 static const struct snd_soc_acpi_link_adr mtl_712_only[] = {
203 .num_adr = ARRAY_SIZE(rt712_0_single_adr),
204 .adr_d = rt712_0_single_adr,
208 .num_adr = ARRAY_SIZE(rt1712_3_single_adr),
209 .adr_d = rt1712_3_single_adr,
214 static const struct snd_soc_acpi_link_adr rt5682_link2_max98373_link0[] = {
215 /* Expected order: jack -> amp */
218 .num_adr = ARRAY_SIZE(rt5682_2_adr),
219 .adr_d = rt5682_2_adr,
223 .num_adr = ARRAY_SIZE(mx8373_0_adr),
224 .adr_d = mx8373_0_adr,
229 static const struct snd_soc_acpi_link_adr mtl_rvp[] = {
232 .num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
233 .adr_d = rt711_sdca_0_adr,
238 static const struct snd_soc_acpi_link_adr mtl_3_in_1_sdca[] = {
241 .num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
242 .adr_d = rt711_sdca_0_adr,
246 .num_adr = ARRAY_SIZE(rt1316_2_group1_adr),
247 .adr_d = rt1316_2_group1_adr,
251 .num_adr = ARRAY_SIZE(rt1316_3_group1_adr),
252 .adr_d = rt1316_3_group1_adr,
256 .num_adr = ARRAY_SIZE(rt714_1_adr),
257 .adr_d = rt714_1_adr,
262 static const struct snd_soc_acpi_link_adr mtl_sdw_rt1318_l12_rt714_l0[] = {
265 .num_adr = ARRAY_SIZE(rt1318_1_group1_adr),
266 .adr_d = rt1318_1_group1_adr,
270 .num_adr = ARRAY_SIZE(rt1318_2_group1_adr),
271 .adr_d = rt1318_2_group1_adr,
275 .num_adr = ARRAY_SIZE(rt714_0_adr),
276 .adr_d = rt714_0_adr,
281 static const struct snd_soc_acpi_adr_device mx8363_2_adr[] = {
283 .adr = 0x000230019F836300ull,
285 .endpoints = &spk_l_endpoint,
286 .name_prefix = "Left"
289 .adr = 0x000231019F836300ull,
291 .endpoints = &spk_r_endpoint,
292 .name_prefix = "Right"
296 static const struct snd_soc_acpi_adr_device cs42l42_0_adr[] = {
298 .adr = 0x00001001FA424200ull,
300 .endpoints = &single_endpoint,
301 .name_prefix = "cs42l42"
305 static const struct snd_soc_acpi_link_adr cs42l42_link0_max98363_link2[] = {
306 /* Expected order: jack -> amp */
309 .num_adr = ARRAY_SIZE(cs42l42_0_adr),
310 .adr_d = cs42l42_0_adr,
314 .num_adr = ARRAY_SIZE(mx8363_2_adr),
315 .adr_d = mx8363_2_adr,
320 /* this table is used when there is no I2S codec present */
321 struct snd_soc_acpi_mach snd_soc_acpi_intel_mtl_sdw_machines[] = {
322 /* mockup tests need to be first */
324 .link_mask = GENMASK(3, 0),
325 .links = sdw_mockup_headset_2amps_mic,
326 .drv_name = "sof_sdw",
327 .sof_tplg_filename = "sof-mtl-rt711-rt1308-rt715.tplg",
330 .link_mask = BIT(0) | BIT(1) | BIT(3),
331 .links = sdw_mockup_headset_1amp_mic,
332 .drv_name = "sof_sdw",
333 .sof_tplg_filename = "sof-mtl-rt711-rt1308-mono-rt715.tplg",
336 .link_mask = GENMASK(2, 0),
337 .links = sdw_mockup_mic_headset_1amp,
338 .drv_name = "sof_sdw",
339 .sof_tplg_filename = "sof-mtl-rt715-rt711-rt1308-mono.tplg",
342 .link_mask = BIT(3) | BIT(0),
343 .links = mtl_712_only,
344 .drv_name = "sof_sdw",
345 .sof_tplg_filename = "sof-mtl-rt712-l0-rt1712-l3.tplg",
348 .link_mask = GENMASK(2, 0),
349 .links = mtl_sdw_rt1318_l12_rt714_l0,
350 .drv_name = "sof_sdw",
351 .sof_tplg_filename = "sof-mtl-rt1318-l12-rt714-l0.tplg"
354 .link_mask = GENMASK(3, 0),
355 .links = mtl_3_in_1_sdca,
356 .drv_name = "sof_sdw",
357 .sof_tplg_filename = "sof-mtl-rt711-l0-rt1316-l23-rt714-l1.tplg",
362 .drv_name = "sof_sdw",
363 .sof_tplg_filename = "sof-mtl-rt711.tplg",
366 .link_mask = BIT(0) | BIT(2),
367 .links = rt5682_link2_max98373_link0,
368 .drv_name = "sof_sdw",
369 .sof_tplg_filename = "sof-mtl-sdw-rt5682-l2-max98373-l0.tplg",
372 .link_mask = BIT(0) | BIT(2),
373 .links = cs42l42_link0_max98363_link2,
374 .drv_name = "sof_sdw",
375 .sof_tplg_filename = "sof-mtl-sdw-cs42l42-l0-max98363-l2.tplg",
379 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_mtl_sdw_machines);