dptf: Add support for Fan Performance States
This change adds support for generating the _FPS table for the DPTF Fan object. The table describes different levels of fan activity that may be applied to the system in order to actively cool it. The information includes fan speed at a (rough) percentage level, fan speed in RPM, potential noise level in centibels, and power in mA. BUG=b:143539650 TEST=compiles Change-Id: I5591eb527f496d0c4c613352d2a87625d47d9273 Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/41889 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
This commit is contained in:
committed by
Patrick Georgi
parent
46f6fcf88f
commit
2ad8ffed6f
@@ -12,6 +12,7 @@
|
||||
enum {
|
||||
ART_REVISION = 0,
|
||||
DEFAULT_PRIORITY = 100,
|
||||
DEFAULT_TRIP_POINT = 0xFFFFFFFFull,
|
||||
DEFAULT_WEIGHT = 100,
|
||||
DPTF_MAX_ART_THRESHOLDS = 10,
|
||||
};
|
||||
@@ -321,3 +322,39 @@ void dptf_write_charger_perf(const struct dptf_charger_perf *states, int max_cou
|
||||
acpigen_pop_len(); /* Method PPSS */
|
||||
acpigen_pop_len(); /* Scope */
|
||||
}
|
||||
|
||||
void dptf_write_fan_perf(const struct dptf_fan_perf *states, int max_count)
|
||||
{
|
||||
char *pkg_count;
|
||||
int i;
|
||||
|
||||
if (!max_count || !states[0].percent)
|
||||
return;
|
||||
|
||||
dptf_write_scope(DPTF_FAN);
|
||||
|
||||
/* _FPS - Fan Performance States */
|
||||
acpigen_write_name("_FPS");
|
||||
pkg_count = acpigen_write_package(0);
|
||||
|
||||
for (i = 0; i < max_count; ++i) {
|
||||
/*
|
||||
* Some _FPS tables do include a last entry where Percent is 0, but Power is
|
||||
* called out, so this table is finished when both are zero.
|
||||
*/
|
||||
if (!states[i].percent && !states[i].power)
|
||||
break;
|
||||
|
||||
(*pkg_count)++;
|
||||
acpigen_write_package(5);
|
||||
acpigen_write_integer(states[i].percent);
|
||||
acpigen_write_integer(DEFAULT_TRIP_POINT);
|
||||
acpigen_write_integer(states[i].speed);
|
||||
acpigen_write_integer(states[i].noise_level);
|
||||
acpigen_write_integer(states[i].power);
|
||||
acpigen_pop_len(); /* inner Package */
|
||||
}
|
||||
|
||||
acpigen_pop_len(); /* Package */
|
||||
acpigen_pop_len(); /* Scope */
|
||||
}
|
||||
|
Reference in New Issue
Block a user