linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: wxt@rock-chips.com (Caesar Wang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/8] thermal: rockchip: fix calculation error for code_to_temp
Date: Wed,  3 Feb 2016 12:12:43 +0800	[thread overview]
Message-ID: <1454472767-5767-5-git-send-email-wxt@rock-chips.com> (raw)
In-Reply-To: <1454472767-5767-1-git-send-email-wxt@rock-chips.com>

From: Elaine Zhang <zhangqing@rock-chips.com>

the calculation use a global table, not their own table.
so adapt the table to the correct one.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
---

 drivers/thermal/rockchip_thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c
index 433085a..5c58d48 100644
--- a/drivers/thermal/rockchip_thermal.c
+++ b/drivers/thermal/rockchip_thermal.c
@@ -411,7 +411,7 @@ static int rk_tsadcv2_code_to_temp(struct chip_tsadc_table table, u32 code,
 	 * temperature between 2 table entries is linear and interpolate
 	 * to produce less granular result.
 	 */
-	num = table.id[mid].temp - v2_code_table[mid - 1].temp;
+	num = table.id[mid].temp - table.id[mid - 1].temp;
 	num *= abs(table.id[mid - 1].code - code);
 	denom = abs(table.id[mid - 1].code - table.id[mid].code);
 	*temp = table.id[mid - 1].temp + (num / denom);
-- 
1.9.1

  parent reply	other threads:[~2016-02-03  4:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-03  4:12 [PATCH 0/8] Support and fixes the rk3228 SoCS for thermal Caesar Wang
2016-02-03  4:12 ` [PATCH 2/8] clk: rockchip: add the tsadc clocks found on rk3228 SoCs Caesar Wang
2016-02-03  4:12 ` [PATCH 3/8] thermal: rockchip: fix a impossible condition caused by the warning Caesar Wang
2016-02-03  4:12 ` Caesar Wang [this message]
2016-02-03  4:12 ` [PATCH 5/8] thermal: rockchip: the rename compatibles for rockchip SoCs Caesar Wang
2016-02-03  4:12 ` [PATCH 6/8] thermal: rockchip: fix the tsadc sequence output on rk3228/rk3399 Caesar Wang
2016-02-03  4:12 ` [PATCH 7/8] ARM: dts: rockchip: enable the tsadc for rk3228 evb Caesar Wang
2016-02-04  1:34   ` kbuild test robot
2016-02-03  4:12 ` [PATCH 8/8] ARM: dts: rockchip: add the thermal main info found on rk3228 Caesar Wang

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=1454472767-5767-5-git-send-email-wxt@rock-chips.com \
    --to=wxt@rock-chips.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).