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>
This commit is contained in:
Tim Wawrzynczak
2020-05-29 14:58:16 -06:00
committed by Patrick Georgi
parent bb5c255907
commit e4d8ebcef7
4 changed files with 89 additions and 0 deletions

View File

@@ -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);
}