ec/google/chromeec: Add support to report fan speed via ACPI

Add fan speed rpm control for DPTF based Active2 policy as per
document #626708, by utilizing existing FAN0 variable from
src/ec/google/chromeec/acpi/emem.asl#18.

There is no corresponding EC change required for this policy
support because EC fan code already exporting this rpm value
using EC_MEMMAP_FAN for FAN0.

BUG=b:224457192
BRANCH=None
TEST=Built and booted on ADL-P based Brya system and
verify the fan speed in rpm under sysfs path
cat /sys/bus/acpi/devices/INTC1048\:00/fan_speed_rpm.

Change-Id: Ibb1646b1fb1659fd853ece97d97bb9dee2a3f57e
Signed-off-by: Sumeet Pawnikar <sumeet.r.pawnikar@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62789
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
This commit is contained in:
Sumeet Pawnikar 2022-03-14 17:13:33 +05:30 committed by Felix Held
parent 8d2bfbce23
commit edbbabcbe7
1 changed files with 6 additions and 0 deletions

View File

@ -109,6 +109,12 @@ static void write_fan_fst(const struct device *ec)
acpigen_emit_namestring("TFST");
acpigen_write_integer(1);
acpigen_emit_byte(ZERO_OP); /* 3rd arg to Index */
acpigen_write_store();
acpigen_emit_namestring(acpi_device_path_join(ec, "FAN0"));
acpigen_emit_byte(INDEX_OP);
acpigen_emit_namestring("TFST");
acpigen_write_integer(2);
acpigen_emit_byte(ZERO_OP);
acpigen_emit_byte(RETURN_OP);
acpigen_emit_namestring("TFST");
acpigen_pop_len(); /* Method _FST */