thermal: move THERMAL_DEVICE_ENABLED
authorHyeonseong Gil <hs.gil@samsung.com>
Wed, 30 Mar 2016 07:52:16 +0000 (16:52 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:09:14 +0000 (17:09 +0900)
THERMAL_DEVICE_ENABLED was set during thermal_zone_of_sensor_register().
it cause incorrect temperature reading before tmu initialize.
So, move it after tmu h/w control.

Change-Id: Ic7fe67ff6a29db87a34f8c189ae2c79014befc5f
Signed-off-by: Hyeonseong Gil <hs.gil@samsung.com>
drivers/thermal/of-thermal.c
drivers/thermal/samsung/exynos_tmu.c

index 6c33f9c09d6a5aa13a2776a93277404d63f386eb..1fb527a169c3ab25d17ec7b32668a7770ba1d388 100644 (file)
@@ -510,8 +510,6 @@ thermal_zone_of_sensor_register(struct device *dev, int sensor_id, void *data,
                if (sensor_specs.np == sensor_np && id == sensor_id) {
                        tzd = thermal_zone_of_add_sensor(child, sensor_np,
                                                         data, ops);
-                       if (!IS_ERR(tzd))
-                               tzd->ops->set_mode(tzd, THERMAL_DEVICE_ENABLED);
 
                        of_node_put(sensor_specs.np);
                        of_node_put(child);
index d1daf319622142fa80146ef332d1ac33aa79ae02..4da916c80e55bfd123ef5f501e137e7c0b81a617 100644 (file)
@@ -724,6 +724,10 @@ static int exynos_tmu_probe(struct platform_device *pdev)
        }
 
        exynos_tmu_control(pdev, true);
+
+       if (!IS_ERR(data->tzd))
+               data->tzd->ops->set_mode(data->tzd, THERMAL_DEVICE_ENABLED);
+
        return 0;
 
 err_thermal: