[PATCH] thermal/of: Initialize the thermal governor for configuring thermal zones.
From: Qibo Huang
Date: Mon Oct 10 2022 - 06:18:09 EST
Configure the initial thermal governor of thermal zones on the device tree.
Since the kernel provides a variety of thermal governors,
to a certain extent,thermal governor is also a specific hardware property
of thermal zones.
Signed-off-by: Qibo Huang <huangqibo.tech@xxxxxxxxx>
---
drivers/thermal/thermal_of.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
index fd2fb84bf246..617b5ac030b4 100644
--- a/drivers/thermal/thermal_of.c
+++ b/drivers/thermal/thermal_of.c
@@ -404,6 +404,11 @@ static struct thermal_zone_params *thermal_of_parameters_init(struct device_node
if (!tzp)
return ERR_PTR(-ENOMEM);
+ if (!of_property_read_string(child, "thermal-governor",
+ &governor_name))
+ strscpy(tzp->governor_name, governor_name,
+ THERMAL_NAME_LENGTH);
+
tzp->no_hwmon = true;
if (!of_property_read_u32(np, "sustainable-power", &prop))
--
2.37.1