Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

of: thermal: Introduce sustainable power for a thermal zone

Introduce an optional property called, sustainable-power, which
represents the power (in mW) which the thermal zone can safely
dissipate.

If provided the property is parsed and associated with the thermal
zone via the thermal zone parameters.

Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>

authored by

Punit Agrawal and committed by
Eduardo Valentin
647f9925 6828a471

+13
+9
Documentation/devicetree/bindings/thermal/thermal.txt
··· 167 167 by means of sensor ID. Additional coefficients are 168 168 interpreted as constant offset. 169 169 170 + - sustainable-power: An estimate of the sustainable power (in mW) that the 171 + Type: unsigned thermal zone can dissipate at the desired 172 + Size: one cell control temperature. For reference, the 173 + sustainable power of a 4'' phone is typically 174 + 2000mW, while on a 10'' tablet is around 175 + 4500mW. 176 + 170 177 Note: The delay properties are bound to the maximum dT/dt (temperature 171 178 derivative over time) in two situations for a thermal zone: 172 179 (i) - when passive cooling is activated (polling-delay-passive); and ··· 552 545 * z = c1*x1 + c2*x2 + c3*x3 553 546 */ 554 547 coefficients = <1200 -345 890>; 548 + 549 + sustainable-power = <2500>; 555 550 556 551 trips { 557 552 /* Trips are based on resulting linear equation */
+4
drivers/thermal/of-thermal.c
··· 866 866 for_each_child_of_node(np, child) { 867 867 struct thermal_zone_device *zone; 868 868 struct thermal_zone_params *tzp; 869 + u32 prop; 869 870 870 871 /* Check whether child is enabled or not */ 871 872 if (!of_device_is_available(child)) ··· 892 891 893 892 /* No hwmon because there might be hwmon drivers registering */ 894 893 tzp->no_hwmon = true; 894 + 895 + if (!of_property_read_u32(child, "sustainable-power", &prop)) 896 + tzp->sustainable_power = prop; 895 897 896 898 zone = thermal_zone_device_register(child->name, tz->ntrips, 897 899 0, tz,