Attention is currently required from: Tim Wawrzynczak. Raul Rangel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/54133 )
Change subject: ec/google/chromeec: Implement support for DRIVERS_ACPI_THERMAL_ZONE ......................................................................
ec/google/chromeec: Implement support for DRIVERS_ACPI_THERMAL_ZONE
This generates the required method to access temperature data from the ChromeEC.
BUG=b:186166365 TEST=Boot guybrush to the OS
Signed-off-by: Raul E Rangel rrangel@chromium.org Change-Id: I418b6691a7d00a4c2d89c9c1fe8f9416602be0f1 --- M src/ec/google/chromeec/Makefile.inc A src/ec/google/chromeec/thermal_zone.c 2 files changed, 20 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/33/54133/1
diff --git a/src/ec/google/chromeec/Makefile.inc b/src/ec/google/chromeec/Makefile.inc index a37d673..a647b09 100644 --- a/src/ec/google/chromeec/Makefile.inc +++ b/src/ec/google/chromeec/Makefile.inc @@ -43,6 +43,7 @@ ramstage-$(CONFIG_EC_GOOGLE_CHROMEEC_SWITCHES) += switches.c
ramstage-$(CONFIG_DRIVERS_INTEL_DPTF) += ec_dptf_helpers.c +ramstage-$(CONFIG_DRIVERS_ACPI_THERMAL_ZONE) += thermal_zone.c
CHROMEEC_SOURCE ?= $(top)/3rdparty/chromeec
diff --git a/src/ec/google/chromeec/thermal_zone.c b/src/ec/google/chromeec/thermal_zone.c new file mode 100644 index 0000000..6031851 --- /dev/null +++ b/src/ec/google/chromeec/thermal_zone.c @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <acpi/acpigen.h> +#include "drivers/acpi/thermal_zone/chip.h" + +enum cb_err acpigen_write_thermal_zone_get_temperature( + const struct drivers_acpi_thermal_zone_config *config) +{ + acpigen_write_method_serialized("_TMP", 0); + + acpigen_emit_byte(RETURN_OP); + /* TODO: Can we search for the CrosEC device? */ + acpigen_emit_namestring("\_SB.PCI0.LPCB.EC0.TSRD"); + acpigen_write_integer(config->temperature_sensor_id); + + acpigen_write_method_end(); + + return CB_SUCCESS; +}