diff mbox series

thermal/of: Initialize the thermal governor for configuring thermal zones.

Message ID 20221010101708.12565-1-huangqibo.tech@gmail.com
State New
Headers show
Series thermal/of: Initialize the thermal governor for configuring thermal zones. | expand

Commit Message

Qibo Huang Oct. 10, 2022, 10:17 a.m. UTC
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@gmail.com>
---
 drivers/thermal/thermal_of.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

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))