thermal: of-thermal: Add governor parsing from device-tree
authorPark Chungwoo <cww.park@samsung.com>
Wed, 9 Mar 2016 05:35:36 +0000 (14:35 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:09:10 +0000 (17:09 +0900)
Change-Id: Ia63bc75ab4595bcf969402c8ea737cb8289b8292
Signed-off-by: Park Chungwoo <cww.park@samsung.com>
Signed-off-by: Hyeonseong Gil <hs.gil@samsung.com>
drivers/thermal/of-thermal.c

index d04ec3b9e5ff21f68aa4a25d4a9d3e4caef0f4ec..6c33f9c09d6a5aa13a2776a93277404d63f386eb 100644 (file)
@@ -973,6 +973,7 @@ int __init of_parse_thermal_zones(void)
        for_each_available_child_of_node(np, child) {
                struct thermal_zone_device *zone;
                struct thermal_zone_params *tzp;
+               const char *governor_name;
                int i, mask = 0;
                u32 prop;
 
@@ -1007,6 +1008,9 @@ int __init of_parse_thermal_zones(void)
                tzp->slope = tz->slope;
                tzp->offset = tz->offset;
 
+               if (!of_property_read_string(child, "governor", &governor_name))
+                       strncpy(tzp->governor_name, governor_name, THERMAL_NAME_LENGTH);
+
                zone = thermal_zone_device_register(child->name, tz->ntrips,
                                                    mask, tz,
                                                    ops, tzp,