It is necessary to be added governor at each thermal_zone.
Because some governors should be operated in the during the kernel booting
in order to avoid heating problem.

Default governor cannot be covered all thermal zones policy because
some thermal zones want to apply different one.
For example, the power allocator governor operates differently with
step wise governor.
Hence, it is better to parse governor parameter from the device tree.

Signed-off-by: Inhyuk Kang <>

diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
index b8e509c..382c440 100644
--- a/drivers/thermal/of-thermal.c
+++ b/drivers/thermal/of-thermal.c
@@ -970,6 +970,7 @@ int __init of_parse_thermal_zones(void)
                struct thermal_zone_device *zone;
                struct thermal_zone_params *tzp;
                int i, mask = 0;
+               const char *governor;
                u32 prop;
                tz = thermal_of_build_thermal_zone(child);
@@ -996,6 +997,9 @@ int __init of_parse_thermal_zones(void)
                if (!of_property_read_u32(child, "sustainable-power", &prop))
                        tzp->sustainable_power = prop;
+               if (!of_property_read_string(child, "governor-name", &governor))
+                       strcpy(tzp->governor_name, governor);
                for (i = 0; i < tz->ntrips; i++)
                        mask |= 1 << i;

Reply via email to