summaryrefslogtreecommitdiff
path: root/src/acpi
diff options
context:
space:
mode:
authorTim Wawrzynczak <twawrzynczak@chromium.org>2020-05-29 14:19:15 -0600
committerPatrick Georgi <pgeorgi@google.com>2020-07-07 17:21:07 +0000
commit3a9cde9ab630fa34240b16f7e6ae10b5a61aa67e (patch)
treeb85c33d30756850725c2866e8394b442a5faca5c /src/acpi
parent7eb1136c27a839a18a4224b970b5a61587e29bd7 (diff)
dptf: Add support for Critical Policies
This patch adds support for DPTF Critical Policies, which are consist of Method definitions only. They are `_CRT` and `_HOT`, which are defined as temperature thresholds that, when exceeded, will execute a graceful suspend or a graceful shutdown, respectively. BUG=b:143539650 TEST=compiles Change-Id: I711ecdcf17ae8f6e653f33069201da4515ace85e Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/41887 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Diffstat (limited to 'src/acpi')
-rw-r--r--src/acpi/acpigen_dptf.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/acpi/acpigen_dptf.c b/src/acpi/acpigen_dptf.c
index abd99c1394..88cf386bc8 100644
--- a/src/acpi/acpigen_dptf.c
+++ b/src/acpi/acpigen_dptf.c
@@ -262,3 +262,21 @@ void dptf_write_passive_policies(const struct dptf_passive_policy *policies, int
write_thermal_relationship_table(policies, max_count);
write_all_PSV(policies, max_count);
}
+
+void dptf_write_critical_policies(const struct dptf_critical_policy *policies, int max_count)
+{
+ int i;
+
+ for (i = 0; i < max_count; ++i) {
+ if (policies[i].source == DPTF_NONE)
+ break;
+
+ dptf_write_scope(policies[i].source);
+
+ /* Choose _CRT or _HOT */
+ write_simple_return_method(policies[i].type == DPTF_CRITICAL_SHUTDOWN ?
+ "_CRT" : "_HOT", to_acpi_temp(policies[i].temp));
+
+ acpigen_pop_len(); /* Scope */
+ }
+}