Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: amd: acp: soc-acpi: add is_device_rt712_vb() helper

Add a filter to skip the RT172 VB configuration if a SmartMic Function
is not found in the SDCA descriptors.

If the ACPI information is incorrect this can only be quirked further
with DMI information.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20260110064505.1485927-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Vijendar Mukunda and committed by
Mark Brown
e7c30ac3 0bef51df

+114
+6
sound/soc/amd/acp/Kconfig
··· 15 15 16 16 config SND_SOC_ACPI_AMD_MATCH 17 17 tristate 18 + select SND_SOC_ACPI_AMD_SDCA_QUIRKS 18 19 select SND_SOC_ACPI if ACPI 20 + 21 + config SND_SOC_ACPI_AMD_SDCA_QUIRKS 22 + tristate 23 + depends on ACPI 24 + depends on SND_SOC_SDCA 19 25 20 26 if SND_SOC_AMD_ACP_COMMON 21 27
+2
sound/soc/amd/acp/Makefile
··· 27 27 snd-acp-sdw-mach-y := acp-sdw-mach-common.o 28 28 snd-acp-sdw-sof-mach-y += acp-sdw-sof-mach.o 29 29 snd-acp-sdw-legacy-mach-y += acp-sdw-legacy-mach.o 30 + snd-soc-acpi-amd-sdca-quirks-y += soc-acpi-amd-sdca-quirks.o 30 31 31 32 obj-$(CONFIG_SND_SOC_AMD_ACP_PCM) += snd-acp-pcm.o 32 33 obj-$(CONFIG_SND_SOC_AMD_ACP_I2S) += snd-acp-i2s.o ··· 41 40 obj-$(CONFIG_SND_AMD_ASOC_ACP63) += snd-acp63.o 42 41 obj-$(CONFIG_SND_AMD_ASOC_ACP70) += snd-acp70.o 43 42 43 + obj-$(CONFIG_SND_SOC_ACPI_AMD_SDCA_QUIRKS) += snd-soc-acpi-amd-sdca-quirks.o 44 44 obj-$(CONFIG_SND_AMD_SOUNDWIRE_ACPI) += snd-amd-sdw-acpi.o 45 45 obj-$(CONFIG_SND_SOC_AMD_MACH_COMMON) += snd-acp-mach.o 46 46 obj-$(CONFIG_SND_SOC_AMD_LEGACY_MACH) += snd-acp-legacy-mach.o
+50
sound/soc/amd/acp/amd-acp70-acpi-match.c
··· 7 7 */ 8 8 9 9 #include <sound/soc-acpi.h> 10 + #include "soc-acpi-amd-sdca-quirks.h" 10 11 #include "../mach-config.h" 11 12 12 13 static const struct snd_soc_acpi_endpoint single_endpoint = { ··· 43 42 .aggregated = 1, 44 43 .group_position = 3, 45 44 .group_id = 1 45 + }; 46 + 47 + static const struct snd_soc_acpi_endpoint jack_amp_g1_dmic_endpoints[] = { 48 + /* Jack Endpoint */ 49 + { 50 + .num = 0, 51 + .aggregated = 0, 52 + .group_position = 0, 53 + .group_id = 0, 54 + }, 55 + /* Amp Endpoint, work as spk_l_endpoint */ 56 + { 57 + .num = 1, 58 + .aggregated = 1, 59 + .group_position = 0, 60 + .group_id = 1, 61 + }, 62 + /* DMIC Endpoint */ 63 + { 64 + .num = 2, 65 + .aggregated = 0, 66 + .group_position = 0, 67 + .group_id = 0, 68 + }, 69 + }; 70 + 71 + static const struct snd_soc_acpi_adr_device rt712_vb_1_group1_adr[] = { 72 + { 73 + .adr = 0x000130025D071201ull, 74 + .num_endpoints = ARRAY_SIZE(jack_amp_g1_dmic_endpoints), 75 + .endpoints = jack_amp_g1_dmic_endpoints, 76 + .name_prefix = "rt712" 77 + } 46 78 }; 47 79 48 80 static const struct snd_soc_acpi_adr_device rt711_rt1316_group_adr[] = { ··· 288 254 {} 289 255 }; 290 256 257 + static const struct snd_soc_acpi_link_adr acp70_alc712_vb_l1[] = { 258 + { 259 + .mask = BIT(1), 260 + .num_adr = ARRAY_SIZE(rt712_vb_1_group1_adr), 261 + .adr_d = rt712_vb_1_group1_adr, 262 + }, 263 + {} 264 + }; 265 + 291 266 static const struct snd_soc_acpi_link_adr acp70_rt722_only[] = { 292 267 { 293 268 .mask = BIT(0), ··· 351 308 .links = acp70_cs35l56x4_l1, 352 309 .drv_name = "amd_sdw", 353 310 }, 311 + { 312 + .link_mask = BIT(1), 313 + .links = acp70_alc712_vb_l1, 314 + .machine_check = snd_soc_acpi_amd_sdca_is_device_rt712_vb, 315 + .drv_name = "amd_sdw", 316 + }, 354 317 {}, 355 318 }; 356 319 EXPORT_SYMBOL(snd_soc_acpi_amd_acp70_sdw_machines); ··· 376 327 MODULE_DESCRIPTION("AMD ACP7.0 & ACP7.1 tables and support for ACPI enumeration"); 377 328 MODULE_LICENSE("GPL"); 378 329 MODULE_AUTHOR("Vijendar.Mukunda@amd.com"); 330 + MODULE_IMPORT_NS("SND_SOC_ACPI_AMD_SDCA_QUIRKS");
+42
sound/soc/amd/acp/soc-acpi-amd-sdca-quirks.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * soc-acpi-amd-sdca-quirks.c - tables and support for SDCA quirks 4 + * 5 + * Copyright(c) 2025 Advanced Micro Devices, Inc. All rights reserved. 6 + * 7 + */ 8 + 9 + #include <linux/soundwire/sdw_amd.h> 10 + #include <sound/sdca.h> 11 + #include <sound/soc-acpi.h> 12 + #include "soc-acpi-amd-sdca-quirks.h" 13 + 14 + /* 15 + * Pretend machine quirk. The argument type is not the traditional 16 + * 'struct snd_soc_acpi_mach' pointer but instead the sdw_amd_ctx 17 + * which contains the peripheral information required for the 18 + * SoundWire/SDCA filter on the SMART_MIC setup and interface 19 + * revision. When the return value is false, the entry in the 20 + * 'snd_soc_acpi_mach' table needs to be skipped. 21 + */ 22 + bool snd_soc_acpi_amd_sdca_is_device_rt712_vb(void *arg) 23 + { 24 + struct sdw_amd_ctx *ctx = arg; 25 + int i; 26 + 27 + if (!ctx) 28 + return false; 29 + 30 + for (i = 0; i < ctx->peripherals->num_peripherals; i++) { 31 + if (sdca_device_quirk_match(ctx->peripherals->array[i], 32 + SDCA_QUIRKS_RT712_VB)) 33 + return true; 34 + } 35 + 36 + return false; 37 + } 38 + EXPORT_SYMBOL_NS(snd_soc_acpi_amd_sdca_is_device_rt712_vb, "SND_SOC_ACPI_AMD_SDCA_QUIRKS"); 39 + 40 + MODULE_DESCRIPTION("ASoC ACPI AMD SDCA quirks"); 41 + MODULE_LICENSE("GPL"); 42 + MODULE_IMPORT_NS("SND_SOC_SDCA");
+14
sound/soc/amd/acp/soc-acpi-amd-sdca-quirks.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + /* 3 + * soc-acpi-amd-sdca-quirks.h - tables and support for SDCA quirks 4 + * 5 + * Copyright(c) 2025 Advanced Micro Devices, Inc. All rights reserved. 6 + * 7 + */ 8 + 9 + #ifndef _SND_SOC_ACPI_AMD_SDCA_QUIRKS 10 + #define _SND_SOC_ACPI_AMD_SDCA_QUIRKS 11 + 12 + bool snd_soc_acpi_amd_sdca_is_device_rt712_vb(void *arg); 13 + 14 + #endif