summaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
authorRanganath Krishnan <ranganath@ti.com>2013-08-23 11:08:23 -0500
committerChanho Park <chanho61.park@samsung.com>2014-11-18 11:45:18 +0900
commite7b52205ca49f5a25ceb3eaa850c36b98fc1a336 (patch)
treede2c7ee0d68fe2c9fe89b8dafc7a5b1c29f35c4d /drivers/thermal
parent191e1dfd62dd47186de4e3f3078b6ee79e324d08 (diff)
downloadlinux-3.10-e7b52205ca49f5a25ceb3eaa850c36b98fc1a336.tar.gz
linux-3.10-e7b52205ca49f5a25ceb3eaa850c36b98fc1a336.tar.bz2
linux-3.10-e7b52205ca49f5a25ceb3eaa850c36b98fc1a336.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')
-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 9dfd47196e6..74c0e3474d6 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",