thermal/drivers/mediatek/lvts_thermal: Retrieve all calibration bytes
authorNicolas Pitre <npitre@baylibre.com>
Tue, 2 Apr 2024 03:25:35 +0000 (23:25 -0400)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Tue, 23 Apr 2024 10:40:29 +0000 (12:40 +0200)
Calibration values are 24-bit wide. Those values so far appear to span
only 16 bits but let's not push our luck.

Found while looking at the original Mediatek driver code.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20240402032729.2736685-2-nico@fluxnic.net
drivers/thermal/mediatek/lvts_thermal.c

index 4e5c213a892254f08c3c7f575e4a0ebde2c81354..d26662608b4c6e9c079850e16eb8d7ac0f2e3a71 100644 (file)
@@ -679,7 +679,7 @@ static int lvts_calibration_init(struct device *dev, struct lvts_ctrl *lvts_ctrl
 
        for (i = 0; i < lvts_ctrl_data->num_lvts_sensor; i++)
                memcpy(&lvts_ctrl->calibration[i],
-                      efuse_calibration + lvts_ctrl_data->cal_offset[i], 2);
+                      efuse_calibration + lvts_ctrl_data->cal_offset[i], 3);
 
        return 0;
 }