Skip to content

Commit

Permalink
thermal: samsung: Only update available threshold limits
Browse files Browse the repository at this point in the history
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.

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>
  • Loading branch information
Tushar Behera authored and Zhang Rui committed May 15, 2014
1 parent ced2284 commit c65d347
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/thermal/samsung/exynos_tmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
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);
Expand All @@ -249,6 +251,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
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,
Expand Down Expand Up @@ -281,6 +284,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
}
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);
Expand Down

0 comments on commit c65d347

Please sign in to comment.