summaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
authorAmit Daniel Kachhap <amit.daniel@samsung.com>2013-06-24 16:20:45 +0530
committerChanho Park <chanho61.park@samsung.com>2014-11-18 11:45:16 +0900
commitd163f2ab0fc5ed4f12bed2ce83a100f3b09af004 (patch)
tree68579c3e2616e04b8c8433dbd65430e3c414c1b3 /drivers/thermal
parent9314ee3d5f6348058f45f49177908ea779ae678f (diff)
downloadlinux-3.10-d163f2ab0fc5ed4f12bed2ce83a100f3b09af004.tar.gz
linux-3.10-d163f2ab0fc5ed4f12bed2ce83a100f3b09af004.tar.bz2
linux-3.10-d163f2ab0fc5ed4f12bed2ce83a100f3b09af004.zip
thermal: exynos: Fix to set the second point correction value
This patch sets the second point trimming value according to the platform data if the register value is 0. Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Acked-by: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/samsung/exynos_tmu.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index 651f4609ebb..3fac0f92bf9 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -180,10 +180,15 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
data->temp_error2 = ((trim_info >> reg->triminfo_85_shift) &
EXYNOS_TMU_TEMP_MASK);
- if ((pdata->min_efuse_value > data->temp_error1) ||
- (data->temp_error1 > pdata->max_efuse_value) ||
- (data->temp_error2 != 0))
- data->temp_error1 = pdata->efuse_value;
+ if (!data->temp_error1 ||
+ (pdata->min_efuse_value > data->temp_error1) ||
+ (data->temp_error1 > pdata->max_efuse_value))
+ data->temp_error1 = pdata->efuse_value & EXYNOS_TMU_TEMP_MASK;
+
+ if (!data->temp_error2)
+ data->temp_error2 =
+ (pdata->efuse_value >> reg->triminfo_85_shift) &
+ EXYNOS_TMU_TEMP_MASK;
if (pdata->max_trigger_level > MAX_THRESHOLD_LEVS) {
dev_err(&pdev->dev, "Invalid max trigger level\n");