[openwrt/openwrt] mediatek: consider adc_oe thermal calibration value in efuse

LEDE Commits lede-commits at lists.infradead.org
Mon Oct 31 15:37:36 PDT 2022


dangole pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/e131a66e307cb108443714e9d57c1eeca12194a1

commit e131a66e307cb108443714e9d57c1eeca12194a1
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Mon Oct 31 19:50:40 2022 +0000

    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 at makrotopia.org>
---
 .../805-thermal-drivers-mediatek-add-support-for-MT7986-and-.patch      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/mediatek/patches-5.15/805-thermal-drivers-mediatek-add-support-for-MT7986-and-.patch b/target/linux/mediatek/patches-5.15/805-thermal-drivers-mediatek-add-support-for-MT7986-and-.patch
index ed72f78009..7ec962a7c3 100644
--- a/target/linux/mediatek/patches-5.15/805-thermal-drivers-mediatek-add-support-for-MT7986-and-.patch
+++ b/target/linux/mediatek/patches-5.15/805-thermal-drivers-mediatek-add-support-for-MT7986-and-.patch
@@ -131,7 +131,7 @@ Signed-off-by: Daniel Golle <daniel at 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;
 +}




More information about the lede-commits mailing list