summaryrefslogtreecommitdiffstats
path: root/drivers/thermal/ti-soc-thermal
diff options
context:
space:
mode:
authorRanganath Krishnan2013-08-23 18:08:23 +0200
committerEduardo Valentin2013-08-29 15:36:18 +0200
commite838ff8119a2aee621d4326f5899b8f4cdae40ac (patch)
treec7b727cf6a31d2a42e61ecbfac7f10b13264c581 /drivers/thermal/ti-soc-thermal
parentthermal: ti-soc-thermal: Set the bandgap mask counter delay value (diff)
downloadkernel-qcow2-linux-e838ff8119a2aee621d4326f5899b8f4cdae40ac.tar.gz
kernel-qcow2-linux-e838ff8119a2aee621d4326f5899b8f4cdae40ac.tar.xz
kernel-qcow2-linux-e838ff8119a2aee621d4326f5899b8f4cdae40ac.zip
thermal: ti-soc-thermal: Ensure to compute thermal trend
Workaround to compute thermal trend even when update interval is not set. This patch will ensure to compute the thermal trend when bandgap counter delay is not set. Signed-off-by: Ranganath Krishnan <ranganath@ti.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Diffstat (limited to 'drivers/thermal/ti-soc-thermal')
-rw-r--r--drivers/thermal/ti-soc-thermal/ti-bandgap.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
index 9dfd47196e63..74c0e3474d6e 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
@@ -1020,9 +1020,13 @@ int ti_bandgap_get_trend(struct ti_bandgap *bgp, int id, int *trend)
/* Fetch the update interval */
ret = ti_bandgap_read_update_interval(bgp, id, &interval);
- if (ret || !interval)
+ if (ret)
goto unfreeze;
+ /* Set the interval to 1 ms if bandgap counter delay is not set */
+ if (interval == 0)
+ interval = 1;
+
*trend = (t1 - t2) / interval;
dev_dbg(bgp->dev, "The temperatures are t1 = %d and t2 = %d and trend =%d\n",