From 9234d9231b177c80281805301d4c67c8ca4d02bb Mon Sep 17 00:00:00 2001 From: Tim Wawrzynczak Date: Wed, 24 Nov 2021 09:19:56 -0700 Subject: ec/google/chromeec: Support 5 temperature sensors Some boards with the chrome EC will need to support more than 4 temperature sensors, so modify the number of TSRs supported when generating the ACPI code. Note that the EC memory map already has support for up to 16 TSRs, so no change is required on the EC side. BUG=b:207585491 TEST=with previous patch and some test data in brya0 overridetree.cb, dump the SSDT and verify that all of the existing Methods for TSR0-TSR3 are also added for TSR4, as well as all Notify, etc. Signed-off-by: Tim Wawrzynczak Change-Id: Id002230bc872b0f818b0bf2b87987298189c973d Reviewed-on: https://review.coreboot.org/c/coreboot/+/59633 Reviewed-by: Arthur Heymans Reviewed-by: Scott Chao Reviewed-by: Sumeet R Pawnikar Tested-by: build bot (Jenkins) --- src/ec/google/chromeec/ec_dptf_helpers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ec/google/chromeec') diff --git a/src/ec/google/chromeec/ec_dptf_helpers.c b/src/ec/google/chromeec/ec_dptf_helpers.c index 631f16ebce..94b13fb5d1 100644 --- a/src/ec/google/chromeec/ec_dptf_helpers.c +++ b/src/ec/google/chromeec/ec_dptf_helpers.c @@ -265,7 +265,7 @@ static void write_dppm_methods(const struct device *ec) /* Local0 = ToInteger(Arg0) */ acpigen_write_to_integer(ARG0_OP, LOCAL0_OP); - for (p = DPTF_TEMP_SENSOR_0, i = 0; p <= DPTF_TEMP_SENSOR_3; ++p, ++i) { + for (p = DPTF_TEMP_SENSOR_0, i = 0; p <= DPTF_TEMP_SENSOR_4; ++p, ++i) { snprintf(name, sizeof(name), "^TSR%1d", i); acpigen_write_if_lequal_op_int(LOCAL0_OP, i); acpigen_notify(name, THERMAL_EVENT); @@ -277,7 +277,7 @@ static void write_dppm_methods(const struct device *ec) /* TPET */ acpigen_write_method("TPET", 0); - for (p = DPTF_TEMP_SENSOR_0, i = 0; p <= DPTF_TEMP_SENSOR_3; ++p, ++i) { + for (p = DPTF_TEMP_SENSOR_0, i = 0; p <= DPTF_TEMP_SENSOR_4; ++p, ++i) { snprintf(name, sizeof(name), "^TSR%1d", i); acpigen_notify(name, TRIP_POINTS_CHANGED_EVENT); } @@ -355,6 +355,6 @@ void ec_fill_dptf_helpers(const struct device *ec) write_charger_methods(ec); write_fan_methods(ec); - for (p = DPTF_TEMP_SENSOR_0, i = 0; p <= DPTF_TEMP_SENSOR_3; ++p, ++i) + for (p = DPTF_TEMP_SENSOR_0, i = 0; p <= DPTF_TEMP_SENSOR_4; ++p, ++i) write_thermal_methods(ec, p, i); } -- cgit v1.2.3