Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1324906

[PATCH 4/8] thermal: rockchip: fix calculation error for code_to_temp

From Caesar Wang <wxt@rock-chips.com>
Newsgroups linux.kernel
Subject [PATCH 4/8] thermal: rockchip: fix calculation error for code_to_temp
Date 2016-02-03 05:20 +0100
Message-ID <qXX58-5ma-27@gated-at.bofh.it> (permalink)
References <qXX57-5ma-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH 0/8] Support and fixes the rk3228 SoCS for thermal Caesar Wang <wxt@rock-chips.com> - 2016-02-03 05:20 +0100
  [PATCH 6/8] thermal: rockchip: fix the tsadc sequence output on rk3228/rk3399 Caesar Wang <wxt@rock-chips.com> - 2016-02-03 05:20 +0100
  [PATCH 3/8] thermal: rockchip: fix a impossible condition caused by the warning Caesar Wang <wxt@rock-chips.com> - 2016-02-03 05:20 +0100
  [PATCH 8/8] ARM: dts: rockchip: add the thermal main info found on rk3228 Caesar Wang <wxt@rock-chips.com> - 2016-02-03 05:20 +0100
  [PATCH 4/8] thermal: rockchip: fix calculation error for code_to_temp Caesar Wang <wxt@rock-chips.com> - 2016-02-03 05:20 +0100

csiph-web