From 82bda5d6398510b66a8640690e18024f039db8da Mon Sep 17 00:00:00 2001 From: Hridya Valsaraju Date: Wed, 26 Feb 2020 15:21:09 -0800 Subject: [PATCH] ANDROID: GKI: drivers: thermal: Indicate in DT the trips are for temperature falling SoCs may need to handle the case where the temperature is below the timing closure temperatures of the logic. At low temperature, the timing closures may not be met. The compensative action at such temperatures is to increase the voltage, by switching to a higher OPP. Thermal governors need to understand that the temperatures are descending in order to correctly estimate the mitigative actions. Change-Id: I56eb249a853d9c8ed9a96ff8a41a1ba87abb29f4 Bug: 149945768 Signed-off-by: Lina Iyer Signed-off-by: Ram Chandrasekar (cherry picked commit from 8a12149c264c7b871932ad90f76e5981452bb4bb) Signed-off-by: Hridya Valsaraju --- Documentation/devicetree/bindings/thermal/thermal.txt | 5 +++++ drivers/thermal/of-thermal.c | 3 +++ include/linux/thermal.h | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/Documentation/devicetree/bindings/thermal/thermal.txt b/Documentation/devicetree/bindings/thermal/thermal.txt index eb7ee91556a5..62ea5737430e 100644 --- a/Documentation/devicetree/bindings/thermal/thermal.txt +++ b/Documentation/devicetree/bindings/thermal/thermal.txt @@ -165,6 +165,11 @@ Optional property: 2000mW, while on a 10'' tablet is around 4500mW. +- tracks-low: Indicates that the temperature sensor tracks the low + Type: bool thresholds, so the governors may mitigate by ensuring + timing closures and other low temperature operating + issues. + Note: The delay properties are bound to the maximum dT/dt (temperature derivative over time) in two situations for a thermal zone: (i) - when passive cooling is activated (polling-delay-passive); and diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c index 4f2816559205..3353ab7b3990 100644 --- a/drivers/thermal/of-thermal.c +++ b/drivers/thermal/of-thermal.c @@ -992,6 +992,9 @@ int __init of_parse_thermal_zones(void) tzp->slope = tz->slope; tzp->offset = tz->offset; + if (of_property_read_bool(child, "tracks-low")) + tzp->tracks_low = true; + zone = thermal_zone_device_register(child->name, tz->ntrips, mask, tz, ops, tzp, diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 5f4705f46c2f..2e0d427fd9a5 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -327,6 +327,12 @@ struct thermal_zone_params { * Used by thermal zone drivers (default 0). */ int offset; + + /* + * @tracks_low: Indicates that the thermal zone params are for + * temperatures falling below the thresholds. + */ + bool tracks_low; }; struct thermal_genl_event {