1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * soc-acpi-intel-cnl-match.c - tables and support for CNL ACPI enumeration.
4  *
5  * Copyright (c) 2018, Intel Corporation.
6  *
7  */
8 
9 #include <sound/soc-acpi.h>
10 #include <sound/soc-acpi-intel-match.h>
11 #include "../skylake/skl.h"
12 #include "soc-acpi-intel-sdw-mockup-match.h"
13 
14 static struct skl_machine_pdata cnl_pdata = {
15 	.use_tplg_pcm = true,
16 };
17 
18 struct snd_soc_acpi_mach snd_soc_acpi_intel_cnl_machines[] = {
19 	{
20 		.id = "INT34C2",
21 		.drv_name = "cnl_rt274",
22 		.fw_filename = "intel/dsp_fw_cnl.bin",
23 		.pdata = &cnl_pdata,
24 		.sof_fw_filename = "sof-cnl.ri",
25 		.sof_tplg_filename = "sof-cnl-rt274.tplg",
26 	},
27 	{},
28 };
29 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_cnl_machines);
30 
31 static const struct snd_soc_acpi_endpoint single_endpoint = {
32 	.num = 0,
33 	.aggregated = 0,
34 	.group_position = 0,
35 	.group_id = 0,
36 };
37 
38 static const struct snd_soc_acpi_adr_device rt5682_2_adr[] = {
39 	{
40 		.adr = 0x000220025D568200ull,
41 		.num_endpoints = 1,
42 		.endpoints = &single_endpoint,
43 		.name_prefix = "rt5682"
44 	}
45 };
46 
47 static const struct snd_soc_acpi_link_adr up_extreme_rt5682_2[] = {
48 	{
49 		.mask = BIT(2),
50 		.num_adr = ARRAY_SIZE(rt5682_2_adr),
51 		.adr_d = rt5682_2_adr,
52 	},
53 	{}
54 };
55 
56 struct snd_soc_acpi_mach snd_soc_acpi_intel_cnl_sdw_machines[] = {
57 	{
58 		.link_mask = BIT(2),
59 		.links = up_extreme_rt5682_2,
60 		.drv_name = "sof_sdw",
61 		.sof_fw_filename = "sof-cnl.ri",
62 		.sof_tplg_filename = "sof-cnl-rt5682-sdw2.tplg"
63 	},
64 	{
65 		.link_mask = GENMASK(3, 0),
66 		.links = sdw_mockup_headset_2amps_mic,
67 		.drv_name = "sof_sdw",
68 		.sof_fw_filename = "sof-cnl.ri",
69 		.sof_tplg_filename = "sof-cml-rt711-rt1308-rt715.tplg",
70 	},
71 	{
72 		.link_mask = BIT(0) | BIT(1) | BIT(3),
73 		.links = sdw_mockup_headset_1amp_mic,
74 		.drv_name = "sof_sdw",
75 		.sof_fw_filename = "sof-cnl.ri",
76 		.sof_tplg_filename = "sof-cml-rt711-rt1308-mono-rt715.tplg",
77 	},
78 	{}
79 };
80 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_cnl_sdw_machines);
81