mediatek: consider adc_oe thermal calibration value in efuse

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>
This commit is contained in:
Daniel Golle 2022-10-31 19:50:40 +00:00
parent 08e153c3c3
commit e131a66e30
No known key found for this signature in database
GPG Key ID: 5A8F39C31C3217CA

View 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;
+}