thermal: sun8i: add TEMP_CALIB_MASK for calibration data in sun50i_h6_ths_calibrate
authorYangtao Li <frank@allwinnertech.com>
Fri, 24 Jul 2020 07:11:42 +0000 (15:11 +0800)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Mon, 12 Oct 2020 10:08:36 +0000 (12:08 +0200)
commit771151bed994850c9afe48a8c8400d6aad33071a
treec4ef369257c76bd960799e427a036c86c0185b55
parent691f189d817bd513b55154d54d9c378fe368bae3
thermal: sun8i: add TEMP_CALIB_MASK for calibration data in sun50i_h6_ths_calibrate

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: Yangtao Li <frank@allwinnertech.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/dcf98648c16aff7649ff82438bfce6caae3e176f.1595572867.git.frank@allwinnertech.com
drivers/thermal/sun8i_thermal.c