Skip to content

Commit

Permalink
thermal: ti-soc-thermal: Ensure to compute thermal trend
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ranganath Krishnan authored and Eduardo Valentin committed Aug 29, 2013
1 parent 10ccff1 commit e838ff8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/thermal/ti-soc-thermal/ti-bandgap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit e838ff8

Please sign in to comment.