FILE
amd-acp63-acpi-match.c
File preview with syntax highlighting.
linux-6.19.14/sound/soc/amd/acp/amd-acp63-acpi-match.c
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * amd-acp63-acpi-match.c - tables and support for ACP 6.3 platform 4 * ACPI enumeration. 5 * 6 * Copyright 2024 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 acp63_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_endpoint cs42l43_endpoints[] = { 121 { /* Jack Playback Endpoint */ 122 .num = 0, 123 .aggregated = 0, 124 .group_position = 0, 125 .group_id = 0, 126 }, 127 { /* DMIC Capture Endpoint */ 128 .num = 1, 129 .aggregated = 0, 130 .group_position = 0, 131 .group_id = 0, 132 }, 133 { /* Jack Capture Endpoint */ 134 .num = 2, 135 .aggregated = 0, 136 .group_position = 0, 137 .group_id = 0, 138 }, 139 { /* Speaker Playback Endpoint */ 140 .num = 3, 141 .aggregated = 0, 142 .group_position = 0, 143 .group_id = 0, 144 }, 145}; 146 147static const struct snd_soc_acpi_adr_device cs35l56x4_l1u3210_adr[] = { 148 { 149 .adr = 0x00013301FA355601ull, 150 .num_endpoints = 1, 151 .endpoints = &spk_l_endpoint, 152 .name_prefix = "AMP1" 153 }, 154 { 155 .adr = 0x00013201FA355601ull, 156 .num_endpoints = 1, 157 .endpoints = &spk_r_endpoint, 158 .name_prefix = "AMP2" 159 }, 160 { 161 .adr = 0x00013101FA355601ull, 162 .num_endpoints = 1, 163 .endpoints = &spk_2_endpoint, 164 .name_prefix = "AMP3" 165 }, 166 { 167 .adr = 0x00013001FA355601ull, 168 .num_endpoints = 1, 169 .endpoints = &spk_3_endpoint, 170 .name_prefix = "AMP4" 171 }, 172}; 173 174static const struct snd_soc_acpi_adr_device cs35l63x2_l0u01_adr[] = { 175 { 176 .adr = 0x00003001FA356301ull, 177 .num_endpoints = 1, 178 .endpoints = &spk_l_endpoint, 179 .name_prefix = "AMP1" 180 }, 181 { 182 .adr = 0x00003101FA356301ull, 183 .num_endpoints = 1, 184 .endpoints = &spk_r_endpoint, 185 .name_prefix = "AMP2" 186 }, 187}; 188 189static const struct snd_soc_acpi_adr_device cs35l63x2_l1u01_adr[] = { 190 { 191 .adr = 0x00013001FA356301ull, 192 .num_endpoints = 1, 193 .endpoints = &spk_l_endpoint, 194 .name_prefix = "AMP1" 195 }, 196 { 197 .adr = 0x00013101FA356301ull, 198 .num_endpoints = 1, 199 .endpoints = &spk_r_endpoint, 200 .name_prefix = "AMP2" 201 }, 202}; 203 204static const struct snd_soc_acpi_adr_device cs35l63x2_l1u13_adr[] = { 205 { 206 .adr = 0x00013101FA356301ull, 207 .num_endpoints = 1, 208 .endpoints = &spk_l_endpoint, 209 .name_prefix = "AMP1" 210 }, 211 { 212 .adr = 0x00013301FA356301ull, 213 .num_endpoints = 1, 214 .endpoints = &spk_r_endpoint, 215 .name_prefix = "AMP2" 216 }, 217}; 218 219static const struct snd_soc_acpi_adr_device cs35l63x4_l0u0246_adr[] = { 220 { 221 .adr = 0x00003001FA356301ull, 222 .num_endpoints = 1, 223 .endpoints = &spk_l_endpoint, 224 .name_prefix = "AMP1" 225 }, 226 { 227 .adr = 0x00003201FA356301ull, 228 .num_endpoints = 1, 229 .endpoints = &spk_r_endpoint, 230 .name_prefix = "AMP2" 231 }, 232 { 233 .adr = 0x00003401FA356301ull, 234 .num_endpoints = 1, 235 .endpoints = &spk_2_endpoint, 236 .name_prefix = "AMP3" 237 }, 238 { 239 .adr = 0x00003601FA356301ull, 240 .num_endpoints = 1, 241 .endpoints = &spk_3_endpoint, 242 .name_prefix = "AMP4" 243 }, 244}; 245 246static const struct snd_soc_acpi_adr_device cs42l43_l0u0_adr[] = { 247 { 248 .adr = 0x00003001FA424301ull, 249 .num_endpoints = ARRAY_SIZE(cs42l43_endpoints), 250 .endpoints = cs42l43_endpoints, 251 .name_prefix = "cs42l43" 252 } 253}; 254 255static const struct snd_soc_acpi_adr_device cs42l43_l0u1_adr[] = { 256 { 257 .adr = 0x00003101FA424301ull, 258 .num_endpoints = ARRAY_SIZE(cs42l43_endpoints), 259 .endpoints = cs42l43_endpoints, 260 .name_prefix = "cs42l43" 261 } 262}; 263 264static const struct snd_soc_acpi_adr_device cs42l43b_l0u1_adr[] = { 265 { 266 .adr = 0x00003101FA2A3B01ull, 267 .num_endpoints = ARRAY_SIZE(cs42l43_endpoints), 268 .endpoints = cs42l43_endpoints, 269 .name_prefix = "cs42l43" 270 } 271}; 272 273static const struct snd_soc_acpi_adr_device cs42l43_l1u0_cs35l56x4_l1u0123_adr[] = { 274 { 275 .adr = 0x00013001FA424301ull, 276 .num_endpoints = ARRAY_SIZE(cs42l43_endpoints), 277 .endpoints = cs42l43_endpoints, 278 .name_prefix = "cs42l43" 279 }, 280 { 281 .adr = 0x00013001FA355601ull, 282 .num_endpoints = 1, 283 .endpoints = &spk_l_endpoint, 284 .name_prefix = "AMP1" 285 }, 286 { 287 .adr = 0x00013101FA355601ull, 288 .num_endpoints = 1, 289 .endpoints = &spk_r_endpoint, 290 .name_prefix = "AMP2" 291 }, 292 { 293 .adr = 0x00013201FA355601ull, 294 .num_endpoints = 1, 295 .endpoints = &spk_2_endpoint, 296 .name_prefix = "AMP3" 297 }, 298 { 299 .adr = 0x00013301FA355601ull, 300 .num_endpoints = 1, 301 .endpoints = &spk_3_endpoint, 302 .name_prefix = "AMP4" 303 }, 304}; 305 306static const struct snd_soc_acpi_adr_device cs42l45_l0u0_adr[] = { 307 { 308 .adr = 0x00003001FA424501ull, 309 /* Re-use endpoints, but cs42l45 has no speaker */ 310 .num_endpoints = ARRAY_SIZE(cs42l43_endpoints) - 1, 311 .endpoints = cs42l43_endpoints, 312 .name_prefix = "cs42l45" 313 } 314}; 315 316static const struct snd_soc_acpi_adr_device cs42l45_l1u0_adr[] = { 317 { 318 .adr = 0x00013001FA424501ull, 319 /* Re-use endpoints, but cs42l45 has no speaker */ 320 .num_endpoints = ARRAY_SIZE(cs42l43_endpoints) - 1, 321 .endpoints = cs42l43_endpoints, 322 .name_prefix = "cs42l45" 323 } 324}; 325 326static const struct snd_soc_acpi_link_adr acp63_cs35l56x4_l1u3210[] = { 327 { 328 .mask = BIT(1), 329 .num_adr = ARRAY_SIZE(cs35l56x4_l1u3210_adr), 330 .adr_d = cs35l56x4_l1u3210_adr, 331 }, 332 {} 333}; 334 335static const struct snd_soc_acpi_link_adr acp63_cs35l63x4_l0u0246[] = { 336 { 337 .mask = BIT(0), 338 .num_adr = ARRAY_SIZE(cs35l63x4_l0u0246_adr), 339 .adr_d = cs35l63x4_l0u0246_adr, 340 }, 341 {} 342}; 343 344static const struct snd_soc_acpi_link_adr acp63_cs42l43_l0u1[] = { 345 { 346 .mask = BIT(0), 347 .num_adr = ARRAY_SIZE(cs42l43_l0u1_adr), 348 .adr_d = cs42l43_l0u1_adr, 349 }, 350 {} 351}; 352 353static const struct snd_soc_acpi_link_adr acp63_cs42l43b_l0u1[] = { 354 { 355 .mask = BIT(0), 356 .num_adr = ARRAY_SIZE(cs42l43b_l0u1_adr), 357 .adr_d = cs42l43b_l0u1_adr, 358 }, 359 {} 360}; 361 362static const struct snd_soc_acpi_link_adr acp63_cs42l43_l0u0_cs35l56x4_l1u3210[] = { 363 { 364 .mask = BIT(0), 365 .num_adr = ARRAY_SIZE(cs42l43_l0u0_adr), 366 .adr_d = cs42l43_l0u0_adr, 367 }, 368 { 369 .mask = BIT(1), 370 .num_adr = ARRAY_SIZE(cs35l56x4_l1u3210_adr), 371 .adr_d = cs35l56x4_l1u3210_adr, 372 }, 373 {} 374}; 375 376static const struct snd_soc_acpi_link_adr acp63_cs42l43_l1u0_cs35l56x4_l1u0123[] = { 377 { 378 .mask = BIT(1), 379 .num_adr = ARRAY_SIZE(cs42l43_l1u0_cs35l56x4_l1u0123_adr), 380 .adr_d = cs42l43_l1u0_cs35l56x4_l1u0123_adr, 381 }, 382 {} 383}; 384 385static const struct snd_soc_acpi_link_adr acp63_cs42l45_l0u0[] = { 386 { 387 .mask = BIT(0), 388 .num_adr = ARRAY_SIZE(cs42l45_l0u0_adr), 389 .adr_d = cs42l45_l0u0_adr, 390 }, 391 {} 392}; 393 394static const struct snd_soc_acpi_link_adr acp63_cs42l45_l0u0_cs35l63x2_l1u01[] = { 395 { 396 .mask = BIT(0), 397 .num_adr = ARRAY_SIZE(cs42l45_l0u0_adr), 398 .adr_d = cs42l45_l0u0_adr, 399 }, 400 { 401 .mask = BIT(1), 402 .num_adr = ARRAY_SIZE(cs35l63x2_l1u01_adr), 403 .adr_d = cs35l63x2_l1u01_adr, 404 }, 405 {} 406}; 407 408static const struct snd_soc_acpi_link_adr acp63_cs42l45_l0u0_cs35l63x2_l1u13[] = { 409 { 410 .mask = BIT(0), 411 .num_adr = ARRAY_SIZE(cs42l45_l0u0_adr), 412 .adr_d = cs42l45_l0u0_adr, 413 }, 414 { 415 .mask = BIT(1), 416 .num_adr = ARRAY_SIZE(cs35l63x2_l1u13_adr), 417 .adr_d = cs35l63x2_l1u13_adr, 418 }, 419 {} 420}; 421 422static const struct snd_soc_acpi_link_adr acp63_cs42l45_l1u0[] = { 423 { 424 .mask = BIT(1), 425 .num_adr = ARRAY_SIZE(cs42l45_l1u0_adr), 426 .adr_d = cs42l45_l1u0_adr, 427 }, 428 {} 429}; 430 431static const struct snd_soc_acpi_link_adr acp63_cs42l45_l1u0_cs35l63x2_l0u01[] = { 432 { 433 .mask = BIT(1), 434 .num_adr = ARRAY_SIZE(cs42l45_l1u0_adr), 435 .adr_d = cs42l45_l1u0_adr, 436 }, 437 { 438 .mask = BIT(0), 439 .num_adr = ARRAY_SIZE(cs35l63x2_l0u01_adr), 440 .adr_d = cs35l63x2_l0u01_adr, 441 }, 442 {} 443}; 444 445static const struct snd_soc_acpi_link_adr acp63_cs42l45_l1u0_cs35l63x4_l0u0246[] = { 446 { 447 .mask = BIT(1), 448 .num_adr = ARRAY_SIZE(cs42l45_l1u0_adr), 449 .adr_d = cs42l45_l1u0_adr, 450 }, 451 { 452 .mask = BIT(0), 453 .num_adr = ARRAY_SIZE(cs35l63x4_l0u0246_adr), 454 .adr_d = cs35l63x4_l0u0246_adr, 455 }, 456 {} 457}; 458 459static const struct snd_soc_acpi_link_adr acp63_rt722_only[] = { 460 { 461 .mask = BIT(0), 462 .num_adr = ARRAY_SIZE(rt722_0_single_adr), 463 .adr_d = rt722_0_single_adr, 464 }, 465 {} 466}; 467 468struct snd_soc_acpi_mach snd_soc_acpi_amd_acp63_sof_sdw_machines[] = { 469 { 470 .link_mask = BIT(0) | BIT(1), 471 .links = acp63_4_in_1_sdca, 472 .drv_name = "amd_sof_sdw", 473 .sof_tplg_filename = "sof-acp_6_3-rt711-l0-rt1316-l0-rt714-l1.tplg", 474 .fw_filename = "sof-acp_6_3.ri", 475 }, 476 {}, 477}; 478EXPORT_SYMBOL(snd_soc_acpi_amd_acp63_sof_sdw_machines); 479 480struct snd_soc_acpi_mach snd_soc_acpi_amd_acp63_sdw_machines[] = { 481 { 482 .link_mask = BIT(0), 483 .links = acp63_rt722_only, 484 .drv_name = "amd_sdw", 485 }, 486 { 487 .link_mask = BIT(0) | BIT(1), 488 .links = acp63_4_in_1_sdca, 489 .drv_name = "amd_sdw", 490 }, 491 { 492 .link_mask = BIT(0) | BIT(1), 493 .links = acp63_cs42l43_l0u0_cs35l56x4_l1u3210, 494 .drv_name = "amd_sdw", 495 }, 496 { 497 .link_mask = BIT(0) | BIT(1), 498 .links = acp63_cs42l45_l1u0_cs35l63x4_l0u0246, 499 .drv_name = "amd_sdw", 500 }, 501 { 502 .link_mask = BIT(0) | BIT(1), 503 .links = acp63_cs42l45_l0u0_cs35l63x2_l1u01, 504 .drv_name = "amd_sdw", 505 }, 506 { 507 .link_mask = BIT(0) | BIT(1), 508 .links = acp63_cs42l45_l0u0_cs35l63x2_l1u13, 509 .drv_name = "amd_sdw", 510 }, 511 { 512 .link_mask = BIT(0) | BIT(1), 513 .links = acp63_cs42l45_l1u0_cs35l63x2_l0u01, 514 .drv_name = "amd_sdw", 515 }, 516 { 517 .link_mask = BIT(1), 518 .links = acp63_cs42l43_l1u0_cs35l56x4_l1u0123, 519 .drv_name = "amd_sdw", 520 }, 521 { 522 .link_mask = BIT(1), 523 .links = acp63_cs35l56x4_l1u3210, 524 .drv_name = "amd_sdw", 525 }, 526 { 527 .link_mask = BIT(0), 528 .links = acp63_cs35l63x4_l0u0246, 529 .drv_name = "amd_sdw", 530 }, 531 { 532 .link_mask = BIT(0), 533 .links = acp63_cs42l43_l0u1, 534 .drv_name = "amd_sdw", 535 }, 536 { 537 .link_mask = BIT(0), 538 .links = acp63_cs42l43b_l0u1, 539 .drv_name = "amd_sdw", 540 }, 541 { 542 .link_mask = BIT(0), 543 .links = acp63_cs42l45_l0u0, 544 .drv_name = "amd_sdw", 545 }, 546 { 547 .link_mask = BIT(1), 548 .links = acp63_cs42l45_l1u0, 549 .drv_name = "amd_sdw", 550 }, 551 {}, 552}; 553EXPORT_SYMBOL(snd_soc_acpi_amd_acp63_sdw_machines); 554 555MODULE_DESCRIPTION("AMD ACP6.3 tables and support for ACPI enumeration"); 556MODULE_LICENSE("GPL"); 557MODULE_AUTHOR("Vijendar.Mukunda@amd.com");
~/
Read-only file preview.