All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ranganath Krishnan <ranganath@ti.com>
To: linux-pm@vger.kernel.org, Eduardo Valentin <eduardo.valentin@ti.com>
Cc: Praneeth Bajjuri <praneeth@ti.com>,
	Ranganath Krishnan <ranganath@ti.com>
Subject: [PATCH 3/3] thermal: ti-soc-thermal: Ensure to compute thermal trend
Date: Fri, 23 Aug 2013 11:08:23 -0500	[thread overview]
Message-ID: <1377274103-27770-3-git-send-email-ranganath@ti.com> (raw)
In-Reply-To: <1377274103-27770-1-git-send-email-ranganath@ti.com>

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>
---
 drivers/thermal/ti-soc-thermal/ti-bandgap.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
index 9dfd471..74c0e34 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",
-- 
1.7.9.5


  parent reply	other threads:[~2013-08-23 16:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-23 16:08 [PATCH 1/3] thermal: ti-soc-thermal: Initialize counter_delay field for TI DRA752 sensors Ranganath Krishnan
2013-08-23 16:08 ` [PATCH 2/3] thermal: ti-soc-thermal: Set the bandgap mask counter delay value Ranganath Krishnan
2013-08-23 16:08 ` Ranganath Krishnan [this message]
2013-08-29 12:19 ` [PATCH 1/3] thermal: ti-soc-thermal: Initialize counter_delay field for TI DRA752 sensors Eduardo Valentin
2013-08-30  8:42   ` Zhang Rui
2013-08-30 12:35     ` Eduardo Valentin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1377274103-27770-3-git-send-email-ranganath@ti.com \
    --to=ranganath@ti.com \
    --cc=eduardo.valentin@ti.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=praneeth@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.