[9810] thermal: samsung: modify TMU calibration for NZVYT lot
authorEunseok Choi <es10.choi@samsung.com>
Wed, 10 May 2017 12:15:29 +0000 (21:15 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:18:54 +0000 (17:18 +0900)
Change-Id: I3b54e21a15b3fd9c5454e2e5c1ee08556f7f8667
Signed-off-by: Eunseok Choi <es10.choi@samsung.com>
drivers/thermal/samsung/exynos_tmu.c

index fc0a01e8956e255750a2c3c1d459c3572506e664..81ed6cebe47e2d469b4e4766646e923486ee7d68 100644 (file)
@@ -43,6 +43,7 @@
 #include <linux/slab.h>
 #include <linux/debugfs.h>
 #include <linux/exynos-ss.h>
+#include <linux/soc/samsung/exynos-soc.h>
 #include <soc/samsung/tmu.h>
 #include <soc/samsung/ect_parser.h>
 #ifdef CONFIG_EXYNOS_MCINFO
@@ -954,6 +955,7 @@ static void exynos78XX_tmu_control(struct platform_device *pdev, bool on)
 
 static int exynos9810_tmu_initialize(struct platform_device *pdev)
 {
+#define NZVYT_LOTID    0x152633
        struct exynos_tmu_data *data = platform_get_drvdata(pdev);
        struct thermal_zone_device *tz = data->tzd;
        struct exynos_tmu_platform_data *pdata = data->pdata;
@@ -968,6 +970,9 @@ static int exynos9810_tmu_initialize(struct platform_device *pdev)
        trim_info = readl(data->base + EXYNOS_TMU_REG_TRIMINFO(0));
        cal_type = (trim_info >> EXYNOS_TMU_CALIB_SEL_SHIFT) & EXYNOS_TMU_CALIB_SEL_MASK;
 
+       if (exynos_soc_info.lot_id == NZVYT_LOTID)
+               cal_type = TYPE_ONE_POINT_TRIMMING;
+
        for (sensor = 0; sensor < TOTAL_SENSORS; sensor++) {
 
                if (!(data->sensors & (1 << sensor)))
@@ -978,6 +983,9 @@ static int exynos9810_tmu_initialize(struct platform_device *pdev)
                temp_error1 = trim_info & EXYNOS_TMU_TEMP_MASK;
                temp_error2 = (trim_info >> EXYNOS_TMU_TRIMINFO_85_P0_SHIFT) & EXYNOS_TMU_TEMP_MASK;
 
+               if (exynos_soc_info.lot_id == NZVYT_LOTID)
+                       temp_error1 = (temp_error1 >> 3) | 0x100;
+
                /* Save sensor id */
                data->sensor_info[count].sensor_num = sensor;
                dev_info(&pdev->dev, "Sensor number = %d\n", sensor);