From: Soomin Kim Date: Thu, 28 Jul 2016 07:06:56 +0000 (+0900) Subject: [8895] thermal: samsung: Save avg_con value X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=76dbb20fc8d98ebe06fab02f26a5dc96514476c0;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [8895] thermal: samsung: Save avg_con value At this moment, G3D sensor doesn't have right value for controlling AVG_CON register. So, save the value of CPU and set it. Change-Id: Ibac586e5ff5692af882738571155898c2d144966 Signed-off-by: Soomin Kim --- diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 576a299595fd..2fbd0df9729f 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -136,6 +136,8 @@ static DEFINE_MUTEX (thermal_suspend_lock); static LIST_HEAD(dtm_dev_list); struct cpufreq_frequency_table gpu_freq_table[10]; +static u32 global_avg_con; + static int find_sensor(struct exynos_tmu_data *data, int start) { int i; @@ -611,6 +613,9 @@ static void exynos8895_tmu_control(struct platform_device *pdev, bool on) avg_con |= EXYNOS_TMU_DEM_ENABLE << EXYNOS_TMU_DEM_SHIFT; } + if (data->id == 0 || data->id == 1) + global_avg_con = avg_con; + /* Set MUX_ADDR SFR according to sensor_type */ switch (data->pdata->sensor_type) { case TEM1456X : @@ -669,7 +674,7 @@ static void exynos8895_tmu_control(struct platform_device *pdev, bool on) /* Only TEM1002X sensor needs AVG_CON setting */ if (data->pdata->sensor_type == TEM1002X) - writel(avg_con, data->base + EXYNOS_TMU_REG_AVG_CON); + writel(global_avg_con, data->base + EXYNOS_TMU_REG_AVG_CON); } static int exynos_get_temp(void *p, int *temp)