[8895] thermal: samsung: Fix threshold offset
authorSoomin Kim <sm8326.kim@samsung.com>
Mon, 25 Jul 2016 07:06:25 +0000 (16:06 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:13:09 +0000 (17:13 +0900)
If sensor number is over 1, threshold register offset
should be start from 0x170.

Change-Id: Ia995e4c42cec74b79395900699fbb70b66be30e2
Signed-off-by: Soomin Kim <sm8326.kim@samsung.com>
drivers/thermal/samsung/exynos_tmu.c

index 4172b72ebc3864248a2994ba672510d5e5940a28..011ef77e30ecdaa355dbd97518bae78c02d45447 100644 (file)
@@ -85,7 +85,7 @@
 
 #define EXYNOS_THD_TEMP_RISE7_6                        0x50
 #define EXYNOS_THD_TEMP_FALL7_6                        0x60
-#define EXYNOS_THD_TEMP_R_OFFSET               0x120
+#define EXYNOS_THD_TEMP_R_OFFSET               0x100
 #define EXYNOS_TMU_INTEN_RISE0_SHIFT           0
 #define EXYNOS_TMU_INTEN_RISE1_SHIFT           1
 #define EXYNOS_TMU_INTEN_RISE2_SHIFT           2
@@ -599,7 +599,8 @@ static int exynos8895_tmu_initialize(struct platform_device *pdev)
                                bit_off = ((8 - i) % 2);
 
                                if (data->sensor_info[j].sensor_num > 0)
-                                       reg_off = reg_off + EXYNOS_THD_TEMP_R_OFFSET;
+                                       reg_off = reg_off + EXYNOS_THD_TEMP_R_OFFSET
+                                               + data->sensor_info[j].sensor_num * 0x20;
 
                                tz->ops->get_trip_temp(tz, i, &temp);
                                temp /= MCELSIUS;