diff options
author | Tushar Behera <tushar.behera@linaro.org> | 2014-04-14 11:08:15 +0530 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-11-18 12:01:01 +0900 |
commit | 94b493fd299c65bfd5809a3c43618f6efccc3608 (patch) | |
tree | 8d7df4bc7bf375d40917c45b1e331fbe376722c5 | |
parent | e2ae146ce61c03b5bfecae78735bcfa5c3911a72 (diff) | |
download | linux-3.10-94b493fd299c65bfd5809a3c43618f6efccc3608.tar.gz linux-3.10-94b493fd299c65bfd5809a3c43618f6efccc3608.tar.bz2 linux-3.10-94b493fd299c65bfd5809a3c43618f6efccc3608.zip |
thermal: samsung: Only update available threshold limits
Currently the threshold limits are updated in 2 stages, once for all
software trigger levels and again for hardware trip point.
While updating the software trigger levels, it overwrites the threshold
limit for hardware trip point thereby forcing the Exynos core to issue
an emergency shutdown.
Updating only the required fields in threshold register fixes this issue.
Change-Id: I7ad7a7eadad874b5ec4ecd7fbed207c01cad4e2f
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
-rw-r--r-- | drivers/thermal/samsung/exynos_tmu.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index eaf9bb72e01..a33c7cade1f 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -227,6 +227,8 @@ skip_calib_data: trigger_levs++; } + rising_threshold = readl(data->base + reg->threshold_th0); + if (data->soc == SOC_ARCH_EXYNOS4210) { /* Write temperature code for threshold */ threshold_code = temp_to_code(data, pdata->threshold); @@ -251,6 +253,7 @@ skip_calib_data: ret = threshold_code; goto out; } + rising_threshold &= ~(0xff << 8 * i); rising_threshold |= threshold_code << 8 * i; if (pdata->threshold_falling) { threshold_code = temp_to_code(data, @@ -283,6 +286,7 @@ skip_calib_data: } if (i == EXYNOS_MAX_TRIGGER_PER_REG - 1) { /* 1-4 level to be assigned in th0 reg */ + rising_threshold &= ~(0xff << 8 * i); rising_threshold |= threshold_code << 8 * i; writel(rising_threshold, data->base + reg->threshold_th0); |