Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit caafe206 authored by Ram Chandrasekar's avatar Ram Chandrasekar
Browse files

drivers: of-thermal: Add support for thermal governor config



Different subsystems in a device require different thermal mitigation
strategies. So using one governor for all the thermal zones will not be
ideal in those cases and there is a need for using different governors to
monitor different thermal zones.

Add support for specifying the thermal governor to be used for a thermal
zone in the devicetree. The devicetree config should specify the
governor name as a string that matches any available governors. The
default governor will be used if the governor name is not specified.

Change-Id: I190194943a93ab6eb5ed5218ec16845db93498b8
Signed-off-by: default avatarRam Chandrasekar <rkumbako@codeaurora.org>
parent cf54360e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -168,6 +168,14 @@ Optional property:
			by means of sensor ID. Additional coefficients are
			interpreted as constant offset.

- thermal-governor:     Thermal governor to be used for this thermal zone.
			Expected values are:
			"step_wise": Use step wise governor.
			"fair_share": Use fair share governor.
			"user_space": Use user space governor.
			"power_allocator": Use power allocator governor.
  Type: string

- sustainable-power:	An estimate of the sustainable power (in mW) that the
  Type: unsigned	thermal zone can dissipate at the desired
  Size: one cell	control temperature.  For reference, the
+6 −0
Original line number Diff line number Diff line
@@ -1128,6 +1128,7 @@ int __init of_parse_thermal_zones(void)
		struct thermal_zone_params *tzp;
		int i, mask = 0;
		u32 prop;
		const char *governor_name;

		tz = thermal_of_build_thermal_zone(child);
		if (IS_ERR(tz)) {
@@ -1150,6 +1151,11 @@ int __init of_parse_thermal_zones(void)
		/* No hwmon because there might be hwmon drivers registering */
		tzp->no_hwmon = true;

		if (!of_property_read_string(child, "thermal-governor",
						&governor_name))
			strlcpy(tzp->governor_name, governor_name,
					THERMAL_NAME_LENGTH);

		if (!of_property_read_u32(child, "sustainable-power", &prop))
			tzp->sustainable_power = prop;