diff options
author | Amit Daniel Kachhap <amit.daniel@samsung.com> | 2013-06-24 06:50:33 -0400 |
---|---|---|
committer | Eduardo Valentin <eduardo.valentin@ti.com> | 2013-08-13 09:52:01 -0400 |
commit | a4463c4f669ac776a1f456fb51fd3c8c99ef904f (patch) | |
tree | eb67cf2c8e413e35dcc3d6e8be1c46b63d8da51c /drivers/thermal | |
parent | 7ca04e587ee5d391fecd477f9a3dd725c3e21f23 (diff) |
thermal: exynos: Fix to clear only the generated interrupts
This patch uses the TMU status register to know the generated interrupts
and only clear them in the interrupt handler.
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r-- | drivers/thermal/samsung/exynos_tmu.c | 11 | ||||
-rw-r--r-- | drivers/thermal/samsung/exynos_tmu_data.c | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 33f494ea1ed1..f6f63ca6faf3 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c | |||
@@ -351,17 +351,16 @@ static void exynos_tmu_work(struct work_struct *work) | |||
351 | struct exynos_tmu_data, irq_work); | 351 | struct exynos_tmu_data, irq_work); |
352 | struct exynos_tmu_platform_data *pdata = data->pdata; | 352 | struct exynos_tmu_platform_data *pdata = data->pdata; |
353 | const struct exynos_tmu_registers *reg = pdata->registers; | 353 | const struct exynos_tmu_registers *reg = pdata->registers; |
354 | unsigned int val_irq; | ||
354 | 355 | ||
355 | exynos_report_trigger(); | 356 | exynos_report_trigger(); |
356 | mutex_lock(&data->lock); | 357 | mutex_lock(&data->lock); |
357 | clk_enable(data->clk); | 358 | clk_enable(data->clk); |
358 | 359 | ||
359 | if (data->soc == SOC_ARCH_EXYNOS) | 360 | /* TODO: take action based on particular interrupt */ |
360 | writel((reg->inten_rise_mask << reg->inten_rise_shift) | | 361 | val_irq = readl(data->base + reg->tmu_intstat); |
361 | (reg->inten_fall_mask << reg->inten_fall_shift), | 362 | /* clear the interrupts */ |
362 | data->base + reg->tmu_intclear); | 363 | writel(val_irq, data->base + reg->tmu_intclear); |
363 | else | ||
364 | writel(reg->inten_rise_mask, data->base + reg->tmu_intclear); | ||
365 | 364 | ||
366 | clk_disable(data->clk); | 365 | clk_disable(data->clk); |
367 | mutex_unlock(&data->lock); | 366 | mutex_unlock(&data->lock); |
diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c index 6cac39310881..217b8f522d32 100644 --- a/drivers/thermal/samsung/exynos_tmu_data.c +++ b/drivers/thermal/samsung/exynos_tmu_data.c | |||
@@ -45,6 +45,7 @@ static const struct exynos_tmu_registers exynos4210_tmu_registers = { | |||
45 | .inten_rise1_shift = EXYNOS_TMU_INTEN_RISE1_SHIFT, | 45 | .inten_rise1_shift = EXYNOS_TMU_INTEN_RISE1_SHIFT, |
46 | .inten_rise2_shift = EXYNOS_TMU_INTEN_RISE2_SHIFT, | 46 | .inten_rise2_shift = EXYNOS_TMU_INTEN_RISE2_SHIFT, |
47 | .inten_rise3_shift = EXYNOS_TMU_INTEN_RISE3_SHIFT, | 47 | .inten_rise3_shift = EXYNOS_TMU_INTEN_RISE3_SHIFT, |
48 | .tmu_intstat = EXYNOS_TMU_REG_INTSTAT, | ||
48 | .tmu_intclear = EXYNOS_TMU_REG_INTCLEAR, | 49 | .tmu_intclear = EXYNOS_TMU_REG_INTCLEAR, |
49 | }; | 50 | }; |
50 | struct exynos_tmu_platform_data const exynos4210_default_tmu_data = { | 51 | struct exynos_tmu_platform_data const exynos4210_default_tmu_data = { |
@@ -112,6 +113,7 @@ static const struct exynos_tmu_registers exynos5250_tmu_registers = { | |||
112 | .inten_rise2_shift = EXYNOS_TMU_INTEN_RISE2_SHIFT, | 113 | .inten_rise2_shift = EXYNOS_TMU_INTEN_RISE2_SHIFT, |
113 | .inten_rise3_shift = EXYNOS_TMU_INTEN_RISE3_SHIFT, | 114 | .inten_rise3_shift = EXYNOS_TMU_INTEN_RISE3_SHIFT, |
114 | .inten_fall0_shift = EXYNOS_TMU_INTEN_FALL0_SHIFT, | 115 | .inten_fall0_shift = EXYNOS_TMU_INTEN_FALL0_SHIFT, |
116 | .tmu_intstat = EXYNOS_TMU_REG_INTSTAT, | ||
115 | .tmu_intclear = EXYNOS_TMU_REG_INTCLEAR, | 117 | .tmu_intclear = EXYNOS_TMU_REG_INTCLEAR, |
116 | .emul_con = EXYNOS_EMUL_CON, | 118 | .emul_con = EXYNOS_EMUL_CON, |
117 | .emul_temp_shift = EXYNOS_EMUL_DATA_SHIFT, | 119 | .emul_temp_shift = EXYNOS_EMUL_DATA_SHIFT, |