diff options
-rw-r--r-- | drivers/thermal/samsung/exynos_tmu.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 736ef7885878..f65e6d807afe 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c | |||
@@ -197,17 +197,9 @@ static int exynos_tmu_initialize(struct platform_device *pdev) | |||
197 | return ret; | 197 | return ret; |
198 | } | 198 | } |
199 | 199 | ||
200 | static void exynos_tmu_control(struct platform_device *pdev, bool on) | 200 | static u32 get_con_reg(struct exynos_tmu_data *data, u32 con) |
201 | { | 201 | { |
202 | struct exynos_tmu_data *data = platform_get_drvdata(pdev); | ||
203 | struct exynos_tmu_platform_data *pdata = data->pdata; | 202 | struct exynos_tmu_platform_data *pdata = data->pdata; |
204 | const struct exynos_tmu_registers *reg = pdata->registers; | ||
205 | unsigned int con, interrupt_en; | ||
206 | |||
207 | mutex_lock(&data->lock); | ||
208 | clk_enable(data->clk); | ||
209 | |||
210 | con = readl(data->base + reg->tmu_ctrl); | ||
211 | 203 | ||
212 | if (pdata->test_mux) | 204 | if (pdata->test_mux) |
213 | con |= (pdata->test_mux << EXYNOS4412_MUX_ADDR_SHIFT); | 205 | con |= (pdata->test_mux << EXYNOS4412_MUX_ADDR_SHIFT); |
@@ -223,6 +215,21 @@ static void exynos_tmu_control(struct platform_device *pdev, bool on) | |||
223 | con |= (pdata->noise_cancel_mode << EXYNOS_TMU_TRIP_MODE_SHIFT); | 215 | con |= (pdata->noise_cancel_mode << EXYNOS_TMU_TRIP_MODE_SHIFT); |
224 | } | 216 | } |
225 | 217 | ||
218 | return con; | ||
219 | } | ||
220 | |||
221 | static void exynos_tmu_control(struct platform_device *pdev, bool on) | ||
222 | { | ||
223 | struct exynos_tmu_data *data = platform_get_drvdata(pdev); | ||
224 | struct exynos_tmu_platform_data *pdata = data->pdata; | ||
225 | const struct exynos_tmu_registers *reg = pdata->registers; | ||
226 | unsigned int con, interrupt_en; | ||
227 | |||
228 | mutex_lock(&data->lock); | ||
229 | clk_enable(data->clk); | ||
230 | |||
231 | con = get_con_reg(data, readl(data->base + reg->tmu_ctrl)); | ||
232 | |||
226 | if (on) { | 233 | if (on) { |
227 | con |= (1 << EXYNOS_TMU_CORE_EN_SHIFT); | 234 | con |= (1 << EXYNOS_TMU_CORE_EN_SHIFT); |
228 | interrupt_en = | 235 | interrupt_en = |