diff options
author | Karthikeyan Ramasubramanian <kramasub@google.com> | 2021-05-27 16:25:28 -0600 |
---|---|---|
committer | Raul Rangel <rrangel@chromium.org> | 2021-06-23 19:19:19 +0000 |
commit | 4ce48b3a37798ad239b30840591ac023b4d811ed (patch) | |
tree | 9fb3f46cc0a85e152e523e65b98966ba21f1f49f /src/soc/amd/common/block/acp | |
parent | 6662fe60e1022e293519d098af8c22001991e9b4 (diff) |
soc/amd/common/acp: Populate _WOV ACPI method
In order to support Audio Co-processor (ACP) DMIC hardware runtime
detection on the platform, ACPI _WOV method is populated on the
concerned ACP device. This method returns the ACPI Integer value as 1
if ACP DMIC exists on the platform.
BUG=b:182960979
TEST=Build and boot to OS in guybrush. Ensure that the _WOV ACPI method
is populated under the scope of ACP device.
Scope (\_SB.PCI0.GP41.ACPD)
{
Method (_WOV, 0, NotSerialized)
{
Return (One)
}
}
Change-Id: Ide84f45f5ea2ae42d5efe71ac6d1595886157045
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55029
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/amd/common/block/acp')
-rw-r--r-- | src/soc/amd/common/block/acp/acp.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/soc/amd/common/block/acp/acp.c b/src/soc/amd/common/block/acp/acp.c index 3cb7c453c8..465a44e2b6 100644 --- a/src/soc/amd/common/block/acp/acp.c +++ b/src/soc/amd/common/block/acp/acp.c @@ -52,6 +52,28 @@ static const char *acp_acpi_name(const struct device *dev) return "ACPD"; } +static void acp_fill_wov_method(const struct device *dev) +{ + const struct soc_amd_common_config *cfg = soc_get_common_config(); + const char *scope = acpi_device_path(dev); + + if (!cfg->acp_config.dmic_present || !scope) + return; + + /* For ACP DMIC hardware runtime detection on the platform, _WOV method is populated. */ + acpigen_write_scope(scope); /* Scope */ + acpigen_write_method("_WOV", 0); + acpigen_write_return_integer(1); + acpigen_write_method_end(); + acpigen_write_scope_end(); +} + +static void acp_fill_ssdt(const struct device *dev) +{ + acpi_device_write_pci_dev(dev); + acp_fill_wov_method(dev); +} + static struct device_operations acp_ops = { .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, @@ -60,7 +82,7 @@ static struct device_operations acp_ops = { .ops_pci = &pci_dev_ops_pci, .scan_bus = scan_static_bus, .acpi_name = acp_acpi_name, - .acpi_fill_ssdt = acpi_device_write_pci_dev, + .acpi_fill_ssdt = acp_fill_ssdt, }; static const struct pci_driver acp_driver __pci_driver = { |