File Index
Files and directories
Sign in
FILE

amd-acp70-acpi-match.c

File preview with syntax highlighting.

linux-6.19.14/sound/soc/amd/acp/amd-acp70-acpi-match.c C
  1// SPDX-License-Identifier: GPL-2.0-only
  2/*
  3 * amd-acp70-acpi-match.c - tables and support for ACP 7.0 & ACP7.1
  4 * ACPI enumeration.
  5 *
  6 * Copyright 2025 Advanced Micro Devices, Inc.
  7 */
  8
  9#include <sound/soc-acpi.h>
 10#include "../mach-config.h"
 11
 12static const struct snd_soc_acpi_endpoint single_endpoint = {
 13	.num = 0,
 14	.aggregated = 0,
 15	.group_position = 0,
 16	.group_id = 0
 17};
 18
 19static const struct snd_soc_acpi_endpoint spk_l_endpoint = {
 20	.num = 0,
 21	.aggregated = 1,
 22	.group_position = 0,
 23	.group_id = 1
 24};
 25
 26static const struct snd_soc_acpi_endpoint spk_r_endpoint = {
 27	.num = 0,
 28	.aggregated = 1,
 29	.group_position = 1,
 30	.group_id = 1
 31};
 32
 33static const struct snd_soc_acpi_endpoint spk_2_endpoint = {
 34	.num = 0,
 35	.aggregated = 1,
 36	.group_position = 2,
 37	.group_id = 1
 38};
 39
 40static const struct snd_soc_acpi_endpoint spk_3_endpoint = {
 41	.num = 0,
 42	.aggregated = 1,
 43	.group_position = 3,
 44	.group_id = 1
 45};
 46
 47static const struct snd_soc_acpi_adr_device rt711_rt1316_group_adr[] = {
 48	{
 49		.adr = 0x000030025D071101ull,
 50		.num_endpoints = 1,
 51		.endpoints = &single_endpoint,
 52		.name_prefix = "rt711"
 53	},
 54	{
 55		.adr = 0x000030025D131601ull,
 56		.num_endpoints = 1,
 57		.endpoints = &spk_l_endpoint,
 58		.name_prefix = "rt1316-1"
 59	},
 60	{
 61		.adr = 0x000032025D131601ull,
 62		.num_endpoints = 1,
 63		.endpoints = &spk_r_endpoint,
 64		.name_prefix = "rt1316-2"
 65	},
 66};
 67
 68static const struct snd_soc_acpi_adr_device rt714_adr[] = {
 69	{
 70		.adr = 0x130025d071401ull,
 71		.num_endpoints = 1,
 72		.endpoints = &single_endpoint,
 73		.name_prefix = "rt714"
 74	}
 75};
 76
 77static const struct snd_soc_acpi_link_adr acp70_4_in_1_sdca[] = {
 78	{	.mask = BIT(0),
 79		.num_adr = ARRAY_SIZE(rt711_rt1316_group_adr),
 80		.adr_d = rt711_rt1316_group_adr,
 81	},
 82	{
 83		.mask = BIT(1),
 84		.num_adr = ARRAY_SIZE(rt714_adr),
 85		.adr_d = rt714_adr,
 86	},
 87	{}
 88};
 89
 90static const struct snd_soc_acpi_endpoint rt722_endpoints[] = {
 91	{
 92		.num = 0,
 93		.aggregated = 0,
 94		.group_position = 0,
 95		.group_id = 0,
 96	},
 97	{
 98		.num = 1,
 99		.aggregated = 0,
100		.group_position = 0,
101		.group_id = 0,
102	},
103	{
104		.num = 2,
105		.aggregated = 0,
106		.group_position = 0,
107		.group_id = 0,
108	},
109};
110
111static const struct snd_soc_acpi_adr_device rt722_0_single_adr[] = {
112	{
113		.adr = 0x000030025d072201ull,
114		.num_endpoints = ARRAY_SIZE(rt722_endpoints),
115		.endpoints = rt722_endpoints,
116		.name_prefix = "rt722"
117	}
118};
119
120static const struct snd_soc_acpi_adr_device rt1320_1_single_adr[] = {
121	{
122		.adr = 0x000130025D132001ull,
123		.num_endpoints = 1,
124		.endpoints = &single_endpoint,
125		.name_prefix = "rt1320-1"
126	}
127};
128
129static const struct snd_soc_acpi_endpoint cs42l43_endpoints[] = {
130	{ /* Jack Playback Endpoint */
131		.num = 0,
132		.aggregated = 0,
133		.group_position = 0,
134		.group_id = 0,
135	},
136	{ /* DMIC Capture Endpoint */
137		.num = 1,
138		.aggregated = 0,
139		.group_position = 0,
140		.group_id = 0,
141	},
142	{ /* Jack Capture Endpoint */
143		.num = 2,
144		.aggregated = 0,
145		.group_position = 0,
146		.group_id = 0,
147	},
148	{ /* Speaker Playback Endpoint */
149		.num = 3,
150		.aggregated = 0,
151		.group_position = 0,
152		.group_id = 0,
153	},
154};
155
156static const struct snd_soc_acpi_adr_device cs42l43_0_adr[] = {
157	{
158		.adr = 0x00003001FA424301ull,
159		.num_endpoints = ARRAY_SIZE(cs42l43_endpoints),
160		.endpoints = cs42l43_endpoints,
161		.name_prefix = "cs42l43"
162	}
163};
164
165static const struct snd_soc_acpi_adr_device cs42l43_1_cs35l56x4_1_adr[] = {
166	{
167		.adr = 0x00013001FA424301ull,
168		.num_endpoints = ARRAY_SIZE(cs42l43_endpoints),
169		.endpoints = cs42l43_endpoints,
170		.name_prefix = "cs42l43"
171	},
172	{
173		.adr = 0x00013001FA355601ull,
174		.num_endpoints = 1,
175		.endpoints = &spk_l_endpoint,
176		.name_prefix = "AMP1"
177	},
178	{
179		.adr = 0x00013101FA355601ull,
180		.num_endpoints = 1,
181		.endpoints = &spk_r_endpoint,
182		.name_prefix = "AMP2"
183	},
184	{
185		.adr = 0x00013201FA355601ull,
186		.num_endpoints = 1,
187		.endpoints = &spk_2_endpoint,
188		.name_prefix = "AMP3"
189	},
190	{
191		.adr = 0x00013301FA355601ull,
192		.num_endpoints = 1,
193		.endpoints = &spk_3_endpoint,
194		.name_prefix = "AMP4"
195	},
196};
197
198static const struct snd_soc_acpi_adr_device cs35l56x4_1_adr[] = {
199	{
200		.adr = 0x00013301FA355601ull,
201		.num_endpoints = 1,
202		.endpoints = &spk_l_endpoint,
203		.name_prefix = "AMP1"
204	},
205	{
206		.adr = 0x00013201FA355601ull,
207		.num_endpoints = 1,
208		.endpoints = &spk_r_endpoint,
209		.name_prefix = "AMP2"
210	},
211	{
212		.adr = 0x00013101FA355601ull,
213		.num_endpoints = 1,
214		.endpoints = &spk_2_endpoint,
215		.name_prefix = "AMP3"
216	},
217	{
218		.adr = 0x00013001FA355601ull,
219		.num_endpoints = 1,
220		.endpoints = &spk_3_endpoint,
221		.name_prefix = "AMP4"
222	},
223};
224
225static const struct snd_soc_acpi_link_adr acp70_cs42l43_l1_cs35l56x4_l1[] = {
226	{
227		.mask = BIT(1),
228		.num_adr = ARRAY_SIZE(cs42l43_1_cs35l56x4_1_adr),
229		.adr_d = cs42l43_1_cs35l56x4_1_adr,
230	},
231	{}
232};
233
234static const struct snd_soc_acpi_link_adr acp70_cs42l43_l0_cs35l56x4_l1[] = {
235	{
236		.mask = BIT(0),
237		.num_adr = ARRAY_SIZE(cs42l43_0_adr),
238		.adr_d = cs42l43_0_adr,
239	},
240	{
241		.mask = BIT(1),
242		.num_adr = ARRAY_SIZE(cs35l56x4_1_adr),
243		.adr_d = cs35l56x4_1_adr,
244	},
245	{}
246};
247
248static const struct snd_soc_acpi_link_adr acp70_cs35l56x4_l1[] = {
249	{
250		.mask = BIT(1),
251		.num_adr = ARRAY_SIZE(cs35l56x4_1_adr),
252		.adr_d = cs35l56x4_1_adr,
253	},
254	{}
255};
256
257static const struct snd_soc_acpi_link_adr acp70_rt722_only[] = {
258	{
259		.mask = BIT(0),
260		.num_adr = ARRAY_SIZE(rt722_0_single_adr),
261		.adr_d = rt722_0_single_adr,
262	},
263	{}
264};
265
266static const struct snd_soc_acpi_link_adr acp70_rt722_l0_rt1320_l1[] = {
267	{
268		.mask = BIT(0),
269		.num_adr = ARRAY_SIZE(rt722_0_single_adr),
270		.adr_d = rt722_0_single_adr,
271	},
272	{
273		.mask = BIT(1),
274		.num_adr = ARRAY_SIZE(rt1320_1_single_adr),
275		.adr_d = rt1320_1_single_adr,
276	},
277	{}
278};
279
280struct snd_soc_acpi_mach snd_soc_acpi_amd_acp70_sdw_machines[] = {
281	{
282		.link_mask = BIT(0) | BIT(1),
283		.links = acp70_rt722_l0_rt1320_l1,
284		.drv_name = "amd_sdw",
285	},
286	{
287		.link_mask = BIT(0),
288		.links = acp70_rt722_only,
289		.drv_name = "amd_sdw",
290	},
291	{
292		.link_mask = BIT(0) | BIT(1),
293		.links = acp70_4_in_1_sdca,
294		.drv_name = "amd_sdw",
295	},
296	{
297		.link_mask = BIT(0) | BIT(1),
298		.links = acp70_cs42l43_l0_cs35l56x4_l1,
299		.drv_name = "amd_sdw",
300	},
301	{
302		.link_mask = BIT(1),
303		.links = acp70_cs42l43_l1_cs35l56x4_l1,
304		.drv_name = "amd_sdw",
305	},
306	{
307		.link_mask = BIT(1),
308		.links = acp70_cs35l56x4_l1,
309		.drv_name = "amd_sdw",
310	},
311	{},
312};
313EXPORT_SYMBOL(snd_soc_acpi_amd_acp70_sdw_machines);
314
315struct snd_soc_acpi_mach snd_soc_acpi_amd_acp70_sof_sdw_machines[] = {
316	{
317		.link_mask = BIT(0),
318		.links = acp70_rt722_only,
319		.drv_name = "amd_sof_sdw",
320		.sof_tplg_filename = "sof-acp_7_0-rt722-l0.tplg",
321		.fw_filename = "sof-acp_7_0.ri",
322	},
323	{},
324};
325EXPORT_SYMBOL(snd_soc_acpi_amd_acp70_sof_sdw_machines);
326
327MODULE_DESCRIPTION("AMD ACP7.0 & ACP7.1 tables and support for ACPI enumeration");
328MODULE_LICENSE("GPL");
329MODULE_AUTHOR("Vijendar.Mukunda@amd.com");
~/ Read-only file preview.