summaryrefslogtreecommitdiff
path: root/src/soc/amd
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/amd')
-rw-r--r--src/soc/amd/common/block/acp/acp.c24
-rw-r--r--src/soc/amd/common/block/include/amdblocks/acp.h7
2 files changed, 30 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 = {
diff --git a/src/soc/amd/common/block/include/amdblocks/acp.h b/src/soc/amd/common/block/include/amdblocks/acp.h
index 2abc600f28..a4c926d246 100644
--- a/src/soc/amd/common/block/include/amdblocks/acp.h
+++ b/src/soc/amd/common/block/include/amdblocks/acp.h
@@ -4,6 +4,7 @@
#define AMD_COMMON_ACP_H
#include <stdint.h>
+#include <types.h>
struct acp_config {
enum {
@@ -19,6 +20,12 @@ struct acp_config {
u8 acp_i2s_wake_enable;
/* Enable ACP PME (0 = disable, 1 = enable) */
u8 acp_pme_enable;
+
+ /*
+ * DMIC present (optional) to support ACP DMIC hardware runtime detection on the
+ * platform. If dmic_present is set to true, it will populate the _WOV ACPI method.
+ */
+ bool dmic_present;
};
#endif /* AMD_COMMON_ACP_H */