From a23c2dd2465b3e835336fe7c694f6a76283dbe68 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Sun, 16 Feb 2025 22:11:27 +0100 Subject: [PATCH] soc/amd/block/acp: add SSDT generation callback into SoC code Some SoCs require adding SoC-specific methods to the ACP's SSDT entry. In order to not add SoC-specific code to the common ACP code, add the 'acp_soc_write_ssdt_entry' callback into the SoC-specific code and guard it via the 'SOC_AMD_COMMON_BLOCK_ACP_SOC_SPECIFIC_SSDT_ENTRY' Kconfig symbol to neither need weak functions or stubs in every SoC code. Change-Id: I0ca5272d28938c8b90b645884a0d8b306a77d473 Signed-off-by: Felix Held Reviewed-on: https://review.coreboot.org/c/coreboot/+/86465 Tested-by: build bot (Jenkins) Reviewed-by: Matt DeVillier --- src/soc/amd/common/block/acp/Kconfig | 6 ++++++ src/soc/amd/common/block/acp/acp.c | 2 ++ src/soc/amd/common/block/include/amdblocks/acp.h | 3 +++ 3 files changed, 11 insertions(+) diff --git a/src/soc/amd/common/block/acp/Kconfig b/src/soc/amd/common/block/acp/Kconfig index bc2dddc1f9..a6ff48327b 100644 --- a/src/soc/amd/common/block/acp/Kconfig +++ b/src/soc/amd/common/block/acp/Kconfig @@ -11,3 +11,9 @@ config SOC_AMD_COMMON_BLOCK_ACP_GEN2 help Select this option to perform Audio Co-Processor(ACP) configuration. Used by the ACP in AMD mendocino (family 17h) and possibly newer CPUs. + +config SOC_AMD_COMMON_BLOCK_ACP_SOC_SPECIFIC_SSDT_ENTRY + bool + help + Select this option to call into the SoC code when generating the SSDT + entry for the Audio Co-Processor (ACP). diff --git a/src/soc/amd/common/block/acp/acp.c b/src/soc/amd/common/block/acp/acp.c index a43792eea7..4985980bf5 100644 --- a/src/soc/amd/common/block/acp/acp.c +++ b/src/soc/amd/common/block/acp/acp.c @@ -39,6 +39,8 @@ static void acp_fill_ssdt(const struct device *dev) { acpi_device_write_pci_dev(dev); acp_fill_wov_method(dev); + if (CONFIG(SOC_AMD_COMMON_BLOCK_ACP_SOC_SPECIFIC_SSDT_ENTRY)) + acp_soc_write_ssdt_entry(dev); } struct device_operations amd_acp_ops = { diff --git a/src/soc/amd/common/block/include/amdblocks/acp.h b/src/soc/amd/common/block/include/amdblocks/acp.h index 04112ca272..3ec38c93d5 100644 --- a/src/soc/amd/common/block/include/amdblocks/acp.h +++ b/src/soc/amd/common/block/include/amdblocks/acp.h @@ -3,6 +3,7 @@ #ifndef AMD_COMMON_ACP_H #define AMD_COMMON_ACP_H +#include #include struct acp_config { @@ -44,4 +45,6 @@ struct acp_config { bool dmic_present; }; +void acp_soc_write_ssdt_entry(const struct device *dev); + #endif /* AMD_COMMON_ACP_H */