From 543466e8bed63e488af92b88c77db091cedc7ae5 Mon Sep 17 00:00:00 2001 From: Hyeonseong Gil Date: Sat, 5 Nov 2016 22:30:37 +0900 Subject: [PATCH] [8895] thermal: samsung: Fix point calibration type Change-Id: I6d15e999b7b8df5d48a274da6928b5195a2519f1 Signed-off-by: Hyeonseong Gil --- drivers/thermal/samsung/exynos_tmu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 82f123ecd9bf..655aadb8b587 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -483,10 +483,12 @@ static int exynos8895_tmu_initialize(struct platform_device *pdev) u32 temp_error1; u32 temp_error2; + trim_info = readl(data->base + EXYNOS_TMU_REG_TRIMINFO); + cal_type = (trim_info >> EXYNOS_TMU_CALIB_SEL_SHIFT) & EXYNOS_TMU_CALIB_SEL_MASK; + for (sensor = 0; sensor < TOTAL_SENSORS; sensor++) { /* Read the sensor error value from TRIMINFOX */ trim_info = readl(data->base + EXYNOS_TMU_REG_TRIMINFO + 0x4 * sensor); - cal_type = (trim_info >> EXYNOS_TMU_CALIB_SEL_SHIFT) & EXYNOS_TMU_CALIB_SEL_MASK; temp_error1 = trim_info & EXYNOS_TMU_TEMP_MASK; temp_error2 = (trim_info >> EXYNOS_TMU_TRIMINFO_85_P0_SHIFT) & EXYNOS_TMU_TEMP_MASK; @@ -505,7 +507,7 @@ static int exynos8895_tmu_initialize(struct platform_device *pdev) data->sensor_info[count].temp_error1 = pdata->efuse_value & EXYNOS_TMU_TEMP_MASK; /* Check temp_error2 if calibration type is TYPE_TWO_POINT_TRIMMING */ - if(pdata->cal_type == TYPE_TWO_POINT_TRIMMING) { + if (data->sensor_info[count].cal_type == TYPE_TWO_POINT_TRIMMING) { data->sensor_info[count].temp_error2 = temp_error2; if (!data->sensor_info[count].temp_error2) -- 2.20.1