Thread (18 messages) 18 messages, 3 authors, 2017-03-30
STALE3380d
Revisions (2)
  1. v1 [diff vs current]
  2. v2 current

[PATCH v2 6/8] thermal: ti-soc-thermal: Fetch slope and offset from DT

From: j-keerthy@ti.com (Keerthy)
Date: 2017-03-09 08:09:49
Also in: linux-omap, linux-pm, lkml
Subsystem: the rest, thermal, ti bandgap and thermal driver · Maintainers: Linus Torvalds, Rafael J. Wysocki, Daniel Lezcano, Eduardo Valentin, Keerthy

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>
---
 drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
index 0586bd0..2054a5c 100644
--- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
+++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
@@ -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 */
-- 
1.9.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help