From edbbabcbe7d3f3dd4e636ab7f363b22687c0399e Mon Sep 17 00:00:00 2001 From: Sumeet Pawnikar Date: Mon, 14 Mar 2022 17:13:33 +0530 Subject: [PATCH] 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/62789 Tested-by: build bot (Jenkins) Reviewed-by: Tim Wawrzynczak --- src/ec/google/chromeec/ec_dptf_helpers.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ec/google/chromeec/ec_dptf_helpers.c b/src/ec/google/chromeec/ec_dptf_helpers.c index 94b13fb5d1..1238bcfbec 100644 --- a/src/ec/google/chromeec/ec_dptf_helpers.c +++ b/src/ec/google/chromeec/ec_dptf_helpers.c @@ -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 */