summaryrefslogtreecommitdiff
path: root/src/acpi
diff options
context:
space:
mode:
authorTim Wawrzynczak <twawrzynczak@chromium.org>2020-05-29 14:58:16 -0600
committerPatrick Georgi <pgeorgi@google.com>2020-07-07 17:23:34 +0000
commite4d8ebcef783f89fb9645d26d339dfb33065530f (patch)
tree64c3e2a82717910329216e4f5ed68430cea9c1d9 /src/acpi
parentbb5c255907378a5c5798b5dab3616df1e63d3ee7 (diff)
downloadcoreboot-e4d8ebcef783f89fb9645d26d339dfb33065530f.tar.xz
dptf: Add support for Fan and TSR options
DPTF has several options on how to control the fan (fine-grained speed control, minimum speed change in percentage points, and whether or not the DPTF device should notify the Fan if it detects low speed). Individual TSRs can also set GTSH, which is the amount of hysteresis inherent in the measurement, either from circuitry (if analog), or in firmware (if digital). BUG=b:143539650 TEST=compiles Change-Id: I42d789d877da28c163e394d7de5fb1ff339264eb Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/41891 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.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/acpi/acpigen_dptf.c b/src/acpi/acpigen_dptf.c
index 9be3f5be8f..59afa551a5 100644
--- a/src/acpi/acpigen_dptf.c
+++ b/src/acpi/acpigen_dptf.c
@@ -404,3 +404,31 @@ void dptf_write_power_limits(const struct dptf_power_limits *limits)
acpigen_pop_len(); /* Method */
acpigen_pop_len(); /* Scope */
}
+
+void dptf_write_STR(const char *str)
+{
+ if (!str)
+ return;
+
+ acpigen_write_name_string("_STR", str);
+}
+
+void dptf_write_fan_options(bool fine_grained, int step_size, bool low_speed_notify)
+{
+ acpigen_write_name("_FIF");
+ acpigen_write_package(4);
+
+ acpigen_write_integer(0); /* Revision */
+ acpigen_write_integer(fine_grained);
+ acpigen_write_integer(step_size);
+ acpigen_write_integer(low_speed_notify);
+ acpigen_pop_len(); /* Package */
+}
+
+void dptf_write_tsr_hysteresis(uint8_t hysteresis)
+{
+ if (!hysteresis)
+ return;
+
+ acpigen_write_name_integer("GTSH", hysteresis);
+}