aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/thermal/samsung/exynos_tmu.c6
-rw-r--r--drivers/thermal/samsung/exynos_tmu.h16
-rw-r--r--drivers/thermal/samsung/exynos_tmu_data.c18
-rw-r--r--drivers/thermal/samsung/exynos_tmu_data.h4
4 files changed, 22 insertions, 22 deletions
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index 0d96a510389f..c308a3d9c0ea 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -238,7 +238,7 @@ skip_calib_data:
238 writeb(pdata->trigger_levels[i], data->base + 238 writeb(pdata->trigger_levels[i], data->base +
239 reg->threshold_th0 + i * sizeof(reg->threshold_th0)); 239 reg->threshold_th0 + i * sizeof(reg->threshold_th0));
240 240
241 writel(reg->inten_rise_mask, data->base + reg->tmu_intclear); 241 writel(reg->intclr_rise_mask, data->base + reg->tmu_intclear);
242 } else { 242 } else {
243 /* Write temperature code for rising and falling threshold */ 243 /* Write temperature code for rising and falling threshold */
244 for (i = 0; 244 for (i = 0;
@@ -265,8 +265,8 @@ skip_calib_data:
265 writel(falling_threshold, 265 writel(falling_threshold,
266 data->base + reg->threshold_th1); 266 data->base + reg->threshold_th1);
267 267
268 writel((reg->inten_rise_mask << reg->inten_rise_shift) | 268 writel((reg->intclr_rise_mask << reg->intclr_rise_shift) |
269 (reg->inten_fall_mask << reg->inten_fall_shift), 269 (reg->intclr_fall_mask << reg->intclr_fall_shift),
270 data->base + reg->tmu_intclear); 270 data->base + reg->tmu_intclear);
271 271
272 /* if last threshold limit is also present */ 272 /* if last threshold limit is also present */
diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h
index 3fb65547e64c..980859a6ad1c 100644
--- a/drivers/thermal/samsung/exynos_tmu.h
+++ b/drivers/thermal/samsung/exynos_tmu.h
@@ -122,10 +122,6 @@ enum soc_type {
122 * @threshold_th3_l0_shift: shift bits of level0 threshold temperature. 122 * @threshold_th3_l0_shift: shift bits of level0 threshold temperature.
123 * @tmu_inten: register containing the different threshold interrupt 123 * @tmu_inten: register containing the different threshold interrupt
124 enable bits. 124 enable bits.
125 * @inten_rise_shift: shift bits of all rising interrupt bits.
126 * @inten_rise_mask: mask bits of all rising interrupt bits.
127 * @inten_fall_shift: shift bits of all rising interrupt bits.
128 * @inten_fall_mask: mask bits of all rising interrupt bits.
129 * @inten_rise0_shift: shift bits of rising 0 interrupt bits. 125 * @inten_rise0_shift: shift bits of rising 0 interrupt bits.
130 * @inten_rise1_shift: shift bits of rising 1 interrupt bits. 126 * @inten_rise1_shift: shift bits of rising 1 interrupt bits.
131 * @inten_rise2_shift: shift bits of rising 2 interrupt bits. 127 * @inten_rise2_shift: shift bits of rising 2 interrupt bits.
@@ -136,6 +132,10 @@ enum soc_type {
136 * @inten_fall3_shift: shift bits of falling 3 interrupt bits. 132 * @inten_fall3_shift: shift bits of falling 3 interrupt bits.
137 * @tmu_intstat: Register containing the interrupt status values. 133 * @tmu_intstat: Register containing the interrupt status values.
138 * @tmu_intclear: Register for clearing the raised interrupt status. 134 * @tmu_intclear: Register for clearing the raised interrupt status.
135 * @intclr_fall_shift: shift bits for interrupt clear fall 0
136 * @intclr_rise_shift: shift bits of all rising interrupt bits.
137 * @intclr_rise_mask: mask bits of all rising interrupt bits.
138 * @intclr_fall_mask: mask bits of all rising interrupt bits.
139 * @emul_con: TMU emulation controller register. 139 * @emul_con: TMU emulation controller register.
140 * @emul_temp_shift: shift bits of emulation temperature. 140 * @emul_temp_shift: shift bits of emulation temperature.
141 * @emul_time_shift: shift bits of emulation time. 141 * @emul_time_shift: shift bits of emulation time.
@@ -191,10 +191,6 @@ struct exynos_tmu_registers {
191 u32 threshold_th3_l0_shift; 191 u32 threshold_th3_l0_shift;
192 192
193 u32 tmu_inten; 193 u32 tmu_inten;
194 u32 inten_rise_shift;
195 u32 inten_rise_mask;
196 u32 inten_fall_shift;
197 u32 inten_fall_mask;
198 u32 inten_rise0_shift; 194 u32 inten_rise0_shift;
199 u32 inten_rise1_shift; 195 u32 inten_rise1_shift;
200 u32 inten_rise2_shift; 196 u32 inten_rise2_shift;
@@ -207,6 +203,10 @@ struct exynos_tmu_registers {
207 u32 tmu_intstat; 203 u32 tmu_intstat;
208 204
209 u32 tmu_intclear; 205 u32 tmu_intclear;
206 u32 intclr_fall_shift;
207 u32 intclr_rise_shift;
208 u32 intclr_fall_mask;
209 u32 intclr_rise_mask;
210 210
211 u32 emul_con; 211 u32 emul_con;
212 u32 emul_temp_shift; 212 u32 emul_temp_shift;
diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c
index 476b768c633e..7d58219b8604 100644
--- a/drivers/thermal/samsung/exynos_tmu_data.c
+++ b/drivers/thermal/samsung/exynos_tmu_data.c
@@ -40,13 +40,13 @@ static const struct exynos_tmu_registers exynos4210_tmu_registers = {
40 .threshold_temp = EXYNOS4210_TMU_REG_THRESHOLD_TEMP, 40 .threshold_temp = EXYNOS4210_TMU_REG_THRESHOLD_TEMP,
41 .threshold_th0 = EXYNOS4210_TMU_REG_TRIG_LEVEL0, 41 .threshold_th0 = EXYNOS4210_TMU_REG_TRIG_LEVEL0,
42 .tmu_inten = EXYNOS_TMU_REG_INTEN, 42 .tmu_inten = EXYNOS_TMU_REG_INTEN,
43 .inten_rise_mask = EXYNOS4210_TMU_TRIG_LEVEL_MASK,
44 .inten_rise0_shift = EXYNOS_TMU_INTEN_RISE0_SHIFT, 43 .inten_rise0_shift = EXYNOS_TMU_INTEN_RISE0_SHIFT,
45 .inten_rise1_shift = EXYNOS_TMU_INTEN_RISE1_SHIFT, 44 .inten_rise1_shift = EXYNOS_TMU_INTEN_RISE1_SHIFT,
46 .inten_rise2_shift = EXYNOS_TMU_INTEN_RISE2_SHIFT, 45 .inten_rise2_shift = EXYNOS_TMU_INTEN_RISE2_SHIFT,
47 .inten_rise3_shift = EXYNOS_TMU_INTEN_RISE3_SHIFT, 46 .inten_rise3_shift = EXYNOS_TMU_INTEN_RISE3_SHIFT,
48 .tmu_intstat = EXYNOS_TMU_REG_INTSTAT, 47 .tmu_intstat = EXYNOS_TMU_REG_INTSTAT,
49 .tmu_intclear = EXYNOS_TMU_REG_INTCLEAR, 48 .tmu_intclear = EXYNOS_TMU_REG_INTCLEAR,
49 .intclr_rise_mask = EXYNOS4210_TMU_TRIG_LEVEL_MASK,
50}; 50};
51 51
52struct exynos_tmu_init_data const exynos4210_default_tmu_data = { 52struct exynos_tmu_init_data const exynos4210_default_tmu_data = {
@@ -112,10 +112,6 @@ static const struct exynos_tmu_registers exynos4412_tmu_registers = {
112 .threshold_th0 = EXYNOS_THD_TEMP_RISE, 112 .threshold_th0 = EXYNOS_THD_TEMP_RISE,
113 .threshold_th1 = EXYNOS_THD_TEMP_FALL, 113 .threshold_th1 = EXYNOS_THD_TEMP_FALL,
114 .tmu_inten = EXYNOS_TMU_REG_INTEN, 114 .tmu_inten = EXYNOS_TMU_REG_INTEN,
115 .inten_rise_mask = EXYNOS_TMU_RISE_INT_MASK,
116 .inten_rise_shift = EXYNOS_TMU_RISE_INT_SHIFT,
117 .inten_fall_mask = EXYNOS_TMU_FALL_INT_MASK,
118 .inten_fall_shift = EXYNOS_TMU_FALL_INT_SHIFT,
119 .inten_rise0_shift = EXYNOS_TMU_INTEN_RISE0_SHIFT, 115 .inten_rise0_shift = EXYNOS_TMU_INTEN_RISE0_SHIFT,
120 .inten_rise1_shift = EXYNOS_TMU_INTEN_RISE1_SHIFT, 116 .inten_rise1_shift = EXYNOS_TMU_INTEN_RISE1_SHIFT,
121 .inten_rise2_shift = EXYNOS_TMU_INTEN_RISE2_SHIFT, 117 .inten_rise2_shift = EXYNOS_TMU_INTEN_RISE2_SHIFT,
@@ -123,6 +119,10 @@ static const struct exynos_tmu_registers exynos4412_tmu_registers = {
123 .inten_fall0_shift = EXYNOS_TMU_INTEN_FALL0_SHIFT, 119 .inten_fall0_shift = EXYNOS_TMU_INTEN_FALL0_SHIFT,
124 .tmu_intstat = EXYNOS_TMU_REG_INTSTAT, 120 .tmu_intstat = EXYNOS_TMU_REG_INTSTAT,
125 .tmu_intclear = EXYNOS_TMU_REG_INTCLEAR, 121 .tmu_intclear = EXYNOS_TMU_REG_INTCLEAR,
122 .intclr_fall_shift = EXYNOS_TMU_CLEAR_FALL_INT_SHIFT,
123 .intclr_rise_shift = EXYNOS_TMU_RISE_INT_SHIFT,
124 .intclr_rise_mask = EXYNOS_TMU_RISE_INT_MASK,
125 .intclr_fall_mask = EXYNOS_TMU_FALL_INT_MASK,
126 .emul_con = EXYNOS_EMUL_CON, 126 .emul_con = EXYNOS_EMUL_CON,
127 .emul_temp_shift = EXYNOS_EMUL_DATA_SHIFT, 127 .emul_temp_shift = EXYNOS_EMUL_DATA_SHIFT,
128 .emul_time_shift = EXYNOS_EMUL_TIME_SHIFT, 128 .emul_time_shift = EXYNOS_EMUL_TIME_SHIFT,
@@ -217,10 +217,6 @@ static const struct exynos_tmu_registers exynos5440_tmu_registers = {
217 .threshold_th2 = EXYNOS5440_TMU_S0_7_TH2, 217 .threshold_th2 = EXYNOS5440_TMU_S0_7_TH2,
218 .threshold_th3_l0_shift = EXYNOS5440_TMU_TH_RISE4_SHIFT, 218 .threshold_th3_l0_shift = EXYNOS5440_TMU_TH_RISE4_SHIFT,
219 .tmu_inten = EXYNOS5440_TMU_S0_7_IRQEN, 219 .tmu_inten = EXYNOS5440_TMU_S0_7_IRQEN,
220 .inten_rise_mask = EXYNOS5440_TMU_RISE_INT_MASK,
221 .inten_rise_shift = EXYNOS5440_TMU_RISE_INT_SHIFT,
222 .inten_fall_mask = EXYNOS5440_TMU_FALL_INT_MASK,
223 .inten_fall_shift = EXYNOS5440_TMU_FALL_INT_SHIFT,
224 .inten_rise0_shift = EXYNOS5440_TMU_INTEN_RISE0_SHIFT, 220 .inten_rise0_shift = EXYNOS5440_TMU_INTEN_RISE0_SHIFT,
225 .inten_rise1_shift = EXYNOS5440_TMU_INTEN_RISE1_SHIFT, 221 .inten_rise1_shift = EXYNOS5440_TMU_INTEN_RISE1_SHIFT,
226 .inten_rise2_shift = EXYNOS5440_TMU_INTEN_RISE2_SHIFT, 222 .inten_rise2_shift = EXYNOS5440_TMU_INTEN_RISE2_SHIFT,
@@ -228,6 +224,10 @@ static const struct exynos_tmu_registers exynos5440_tmu_registers = {
228 .inten_fall0_shift = EXYNOS5440_TMU_INTEN_FALL0_SHIFT, 224 .inten_fall0_shift = EXYNOS5440_TMU_INTEN_FALL0_SHIFT,
229 .tmu_intstat = EXYNOS5440_TMU_S0_7_IRQ, 225 .tmu_intstat = EXYNOS5440_TMU_S0_7_IRQ,
230 .tmu_intclear = EXYNOS5440_TMU_S0_7_IRQ, 226 .tmu_intclear = EXYNOS5440_TMU_S0_7_IRQ,
227 .intclr_fall_shift = EXYNOS5440_TMU_CLEAR_FALL_INT_SHIFT,
228 .intclr_rise_shift = EXYNOS5440_TMU_RISE_INT_SHIFT,
229 .intclr_rise_mask = EXYNOS5440_TMU_RISE_INT_MASK,
230 .intclr_fall_mask = EXYNOS5440_TMU_FALL_INT_MASK,
231 .tmu_irqstatus = EXYNOS5440_TMU_IRQ_STATUS, 231 .tmu_irqstatus = EXYNOS5440_TMU_IRQ_STATUS,
232 .emul_con = EXYNOS5440_TMU_S0_7_DEBUG, 232 .emul_con = EXYNOS5440_TMU_S0_7_DEBUG,
233 .emul_temp_shift = EXYNOS_EMUL_DATA_SHIFT, 233 .emul_temp_shift = EXYNOS_EMUL_DATA_SHIFT,
diff --git a/drivers/thermal/samsung/exynos_tmu_data.h b/drivers/thermal/samsung/exynos_tmu_data.h
index a1ea19d9e0a6..d9495a441560 100644
--- a/drivers/thermal/samsung/exynos_tmu_data.h
+++ b/drivers/thermal/samsung/exynos_tmu_data.h
@@ -69,9 +69,10 @@
69#define EXYNOS_TMU_RISE_INT_MASK 0x111 69#define EXYNOS_TMU_RISE_INT_MASK 0x111
70#define EXYNOS_TMU_RISE_INT_SHIFT 0 70#define EXYNOS_TMU_RISE_INT_SHIFT 0
71#define EXYNOS_TMU_FALL_INT_MASK 0x111 71#define EXYNOS_TMU_FALL_INT_MASK 0x111
72#define EXYNOS_TMU_FALL_INT_SHIFT 12
73#define EXYNOS_TMU_CLEAR_RISE_INT 0x111 72#define EXYNOS_TMU_CLEAR_RISE_INT 0x111
74#define EXYNOS_TMU_CLEAR_FALL_INT (0x111 << 12) 73#define EXYNOS_TMU_CLEAR_FALL_INT (0x111 << 12)
74#define EXYNOS_TMU_CLEAR_FALL_INT_SHIFT 12
75#define EXYNOS5440_TMU_CLEAR_FALL_INT_SHIFT 4
75#define EXYNOS_TMU_TRIP_MODE_SHIFT 13 76#define EXYNOS_TMU_TRIP_MODE_SHIFT 13
76#define EXYNOS_TMU_TRIP_MODE_MASK 0x7 77#define EXYNOS_TMU_TRIP_MODE_MASK 0x7
77#define EXYNOS_TMU_THERM_TRIP_EN_SHIFT 12 78#define EXYNOS_TMU_THERM_TRIP_EN_SHIFT 12
@@ -119,7 +120,6 @@
119#define EXYNOS5440_TMU_RISE_INT_MASK 0xf 120#define EXYNOS5440_TMU_RISE_INT_MASK 0xf
120#define EXYNOS5440_TMU_RISE_INT_SHIFT 0 121#define EXYNOS5440_TMU_RISE_INT_SHIFT 0
121#define EXYNOS5440_TMU_FALL_INT_MASK 0xf 122#define EXYNOS5440_TMU_FALL_INT_MASK 0xf
122#define EXYNOS5440_TMU_FALL_INT_SHIFT 4
123#define EXYNOS5440_TMU_INTEN_RISE0_SHIFT 0 123#define EXYNOS5440_TMU_INTEN_RISE0_SHIFT 0
124#define EXYNOS5440_TMU_INTEN_RISE1_SHIFT 1 124#define EXYNOS5440_TMU_INTEN_RISE1_SHIFT 1
125#define EXYNOS5440_TMU_INTEN_RISE2_SHIFT 2 125#define EXYNOS5440_TMU_INTEN_RISE2_SHIFT 2