mediatek: consider adc_oe thermal calibration value in efuse
authorDaniel Golle <daniel@makrotopia.org>
Mon, 31 Oct 2022 19:50:40 +0000 (19:50 +0000)
committerDaniel Golle <daniel@makrotopia.org>
Mon, 31 Oct 2022 22:37:05 +0000 (22:37 +0000)
The use of the adc_oe value stored in the efuse has been dropped in
MediaTek's SDK during a recent refactorization of the temperature
calculation formula. Don't ignore this offset value and again include
it in raw-to-deg-celsius calculation.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
target/linux/mediatek/patches-5.15/805-thermal-drivers-mediatek-add-support-for-MT7986-and-.patch

index ed72f78009f80f3160d8fefea77bd11d236eb1b7..7ec962a7c386e0e79035995f145564733b8894fe 100644 (file)
@@ -131,7 +131,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
 +      tmp = 100000 * 15 / 16 * 10000;
 +      tmp /= 4096 - 512 + mt->adc_ge;
 +      tmp /= 1490;
-+      tmp *= raw - mt->vts[sensno] - 2900;
++      tmp *= raw - mt->vts[sensno] - 2900 - mt->adc_oe + 512;
 +
 +      return mt->degc_cali * 500 - tmp;
 +}