From: Frank Lee <frank@allwinnertech.com>
To: robh+dt@kernel.org, mripard@kernel.org, wens@csie.org,
mturquette@baylibre.com, sboyd@kernel.org,
gregory.clement@bootlin.com, tglx@linutronix.de,
jason@lakedaemon.net, maz@kernel.org,
srinivas.kandagatla@linaro.org, linus.walleij@linaro.org,
anarsoul@gmail.com, tiny.windzz@gmail.com, rui.zhang@intel.com,
daniel.lezcano@linaro.org, amit.kucheria@verdurent.com,
lee.jones@linaro.org, p.zabel@pengutronix.de,
clabbe@baylibre.com, icenowy@aosc.io, megous@megous.com,
stefan@olimex.com, bage@linutronix.de
Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
linux-i2c@vger.kernel.org, linux-gpio@vger.kernel.org,
linux-pm@vger.kernel.org, huangshuosheng@allwinnertech.com,
liyong@allwinnertech.com, Frank Lee <frank@allwinnertech.com>
Subject: [PATCH v3 08/16] thermal: sun8i: add TEMP_CALIB_MASK for calibration data in sun50i_h6_ths_calibrate
Date: Wed, 8 Jul 2020 15:19:34 +0800 [thread overview]
Message-ID: <20200708071942.22595-9-frank@allwinnertech.com> (raw)
In-Reply-To: <20200708071942.22595-1-frank@allwinnertech.com>
For sun50i_h6_ths_calibrate(), the data read from nvmem needs a round of
calculation. On the other hand, the newer SOC may store other data in
the space other than 12bit sensor data. Add mask operation to read data
to avoid conversion error.
Signed-off-by: Frank Lee <frank@allwinnertech.com>
Reviewed-by: Yangtao Li <tiny.windzz@gmail.com>
---
drivers/thermal/sun8i_thermal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/thermal/sun8i_thermal.c b/drivers/thermal/sun8i_thermal.c
index 74d73be..f423d44 100644
--- a/drivers/thermal/sun8i_thermal.c
+++ b/drivers/thermal/sun8i_thermal.c
@@ -244,7 +244,7 @@ static int sun50i_h6_ths_calibrate(struct ths_device *tmdev,
ft_temp = (caldata[0] & FT_TEMP_MASK) * 100;
for (i = 0; i < tmdev->chip->sensor_num; i++) {
- int sensor_reg = caldata[i + 1];
+ int sensor_reg = caldata[i + 1] & TEMP_CALIB_MASK;
int cdata, offset;
int sensor_temp = tmdev->chip->calc_temp(tmdev, i, sensor_reg);
--
1.9.1
next prev parent reply other threads:[~2020-07-08 7:20 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-08 7:19 [PATCH v3 00/16] Allwinner A100 Initial support Frank Lee
2020-07-08 7:19 ` [PATCH v3 01/16] dt-bindings: clk: sunxi-ccu: add compatible string for A100 CCU and R-CCU Frank Lee
2020-07-13 22:54 ` Rob Herring
2020-07-13 23:33 ` Rob Herring
2020-07-08 7:19 ` [PATCH v3 02/16] clk: sunxi-ng: add support for the Allwinner A100 CCU Frank Lee
2020-07-08 7:19 ` [PATCH v3 03/16] dt-bindings: pinctrl: sunxi: Add A100 pinctrl bindings Frank Lee
2020-07-13 23:01 ` Rob Herring
2020-07-08 7:19 ` [PATCH v3 04/16] dt-bindings: pinctrl: sunxi: make gpio banks supplies required Frank Lee
2020-07-09 16:52 ` Rob Herring
2020-07-09 16:54 ` Rob Herring
2020-07-09 17:17 ` Ondřej Jirman
2020-07-10 12:37 ` Maxime Ripard
2020-07-13 2:32 ` Frank Lee
2020-07-08 7:19 ` [PATCH v3 05/16] pinctrl: sunxi: add support for the Allwinner A100 pin controller Frank Lee
2020-07-08 7:19 ` [PATCH v3 06/16] dt-bindings: nvmem: SID: add binding for A100's SID controller Frank Lee
2020-07-09 16:54 ` Rob Herring
2020-07-08 7:19 ` [PATCH v3 07/16] dt-bindings: thermal: sun8i: Add binding for A100's THS controller Frank Lee
2020-07-13 23:02 ` Rob Herring
2020-07-08 7:19 ` Frank Lee [this message]
2020-07-08 7:19 ` [PATCH v3 09/16] thermal: sun8i: Add A100's THS controller support Frank Lee
2020-07-08 7:19 ` [PATCH v3 10/16] mfd: axp20x: Allow the AXP803 to be probed by I2C Frank Lee
2020-07-16 15:10 ` Lee Jones
2020-07-08 7:45 ` [PATCH v3 00/16] Allwinner A100 Initial support Corentin Labbe
2020-07-13 2:41 ` Frank Lee
2020-07-10 14:28 ` Maxime Ripard
2020-07-13 2:39 ` Frank Lee
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=20200708071942.22595-9-frank@allwinnertech.com \
--to=frank@allwinnertech.com \
--cc=amit.kucheria@verdurent.com \
--cc=anarsoul@gmail.com \
--cc=bage@linutronix.de \
--cc=clabbe@baylibre.com \
--cc=daniel.lezcano@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=gregory.clement@bootlin.com \
--cc=huangshuosheng@allwinnertech.com \
--cc=icenowy@aosc.io \
--cc=jason@lakedaemon.net \
--cc=lee.jones@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=liyong@allwinnertech.com \
--cc=maz@kernel.org \
--cc=megous@megous.com \
--cc=mripard@kernel.org \
--cc=mturquette@baylibre.com \
--cc=p.zabel@pengutronix.de \
--cc=robh+dt@kernel.org \
--cc=rui.zhang@intel.com \
--cc=sboyd@kernel.org \
--cc=srinivas.kandagatla@linaro.org \
--cc=stefan@olimex.com \
--cc=tglx@linutronix.de \
--cc=tiny.windzz@gmail.com \
--cc=wens@csie.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).