From 3fc82b26d4ec5acc7d28668a8c699620eecf5c9e Mon Sep 17 00:00:00 2001 From: Eunseok Choi Date: Tue, 30 May 2017 16:23:42 +0900 Subject: [PATCH] [9810] thermal: samsung: reduce TMU sending time Change-Id: I624b15d3a2c4173f593dcff1e18c3481563c8114 Signed-off-by: Eunseok Choi --- drivers/thermal/samsung/exynos_tmu.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index acebe3a4f3bf..c489025989cb 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -159,6 +159,7 @@ #define EXYNOS_TMU_CLK_SENSE_ON_SHIFT (16) #define EXYNOS_TMU_CLK_SENSE_ON_MASK (0xffff) #define EXYNOS_TMU_TEM1456X_SENSE_VALUE (0x0A28) +#define EXYNOS_TMU_TEM1051X_SENSE_VALUE (0x028A) #define EXYNOS_TMU_NUM_PROBE_SHIFT (16) #if defined(CONFIG_SOC_EXYNOS9810) @@ -1134,6 +1135,7 @@ static void exynos9810_tmu_control(struct platform_device *pdev, bool on) struct exynos_tmu_data *data = platform_get_drvdata(pdev); unsigned int trim, ctrl, con1, avgc; unsigned int t_buf_vref_sel, t_buf_slope_sel, avg_mode; + unsigned int counter_value; tmu_core_disable(pdev); tmu_irqs_disable(pdev); @@ -1177,6 +1179,17 @@ static void exynos9810_tmu_control(struct platform_device *pdev, bool on) } writel(avgc, data->base + EXYNOS_TMU_REG_AVG_CON); + /* set COUNTER_VALUE */ + counter_value = readl(data->base + EXYNOS_TMU_REG_COUNTER_VALUE0); + counter_value &= ~(EXYNOS_TMU_EN_TEMP_SEN_OFF_MASK << EXYNOS_TMU_EN_TEMP_SEN_OFF_SHIFT); + counter_value |= EXYNOS_TMU_TEM1051X_SENSE_VALUE << EXYNOS_TMU_EN_TEMP_SEN_OFF_SHIFT; + writel(counter_value, data->base + EXYNOS_TMU_REG_COUNTER_VALUE0); + + counter_value = readl(data->base + EXYNOS_TMU_REG_COUNTER_VALUE1); + counter_value &= ~(EXYNOS_TMU_CLK_SENSE_ON_MASK << EXYNOS_TMU_CLK_SENSE_ON_SHIFT); + counter_value |= EXYNOS_TMU_TEM1051X_SENSE_VALUE << EXYNOS_TMU_CLK_SENSE_ON_SHIFT; + writel(counter_value, data->base + EXYNOS_TMU_REG_COUNTER_VALUE1); + tmu_irqs_enable(pdev); tmu_core_enable(pdev); } -- 2.20.1