]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
thermal: ti-soc-thermal: Fetch slope and offset from DT
authorKeerthy <j-keerthy@ti.com>
Thu, 9 Mar 2017 08:06:00 +0000 (13:36 +0530)
committerEduardo Valentin <edubezval@gmail.com>
Thu, 30 Mar 2017 05:14:28 +0000 (22:14 -0700)
Currently slope and offset values for calculating the hot spot
temperature of a thermal zone is being taken directly from driver
data. So fetch them from device tree.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
drivers/thermal/ti-soc-thermal/ti-thermal-common.c

index 0586bd0f2bab676f1c780bc1bc0499919ed5f88e..2054a5c06e86e082b980363dd2cd56b73c5925e7 100644 (file)
@@ -96,8 +96,8 @@ static inline int __ti_thermal_get_temp(void *devdata, int *temp)
                return ret;
 
        /* Default constants */
-       slope = s->slope;
-       constant = s->constant;
+       slope = thermal_zone_get_slope(data->ti_thermal);
+       constant = thermal_zone_get_offset(data->ti_thermal);
 
        pcb_tz = data->pcb_tz;
        /* In case pcb zone is available, use the extrapolation rule with it */