aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2014-11-13 10:00:57 -0500
committerEduardo Valentin <edubezval@gmail.com>2014-11-20 09:52:23 -0500
commit5d022061cabe5b4967d9f5b65d2ce9c121aa458a (patch)
treec126b51e8302d973cb429ff6f3090b15983723e1
parent77109411d5d24471ffa391dce56ba3559fb87d94 (diff)
thermal: exynos: remove needless tmu_status abstraction
reg->tmu_status is used only in exynos_tmu_initialize() and it is accessed only if TMU_SUPPORT_READY_STATUS flag is set. This flag is not set for Exynos5440 and TMU_STATUS register offset is identical for all other SoC types so the abstraction is not needed and can be removed. There should be no functional changes caused by this patch. Cc: Amit Daniel Kachhap <amit.daniel@samsung.com> Cc: Lukasz Majewski <l.majewski@samsung.com> Cc: Eduardo Valentin <edubezval@gmail.com> Cc: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Tested-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
-rw-r--r--drivers/thermal/samsung/exynos_tmu.c2
-rw-r--r--drivers/thermal/samsung/exynos_tmu.h3
-rw-r--r--drivers/thermal/samsung/exynos_tmu_data.c6
-rw-r--r--drivers/thermal/samsung/exynos_tmu_data.h1
4 files changed, 1 insertions, 11 deletions
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index bb05355620c2..ac436379d9ce 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -154,7 +154,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
154 clk_enable(data->clk_sec); 154 clk_enable(data->clk_sec);
155 155
156 if (TMU_SUPPORTS(pdata, READY_STATUS)) { 156 if (TMU_SUPPORTS(pdata, READY_STATUS)) {
157 status = readb(data->base + reg->tmu_status); 157 status = readb(data->base + EXYNOS_TMU_REG_STATUS);
158 if (!status) { 158 if (!status) {
159 ret = -EBUSY; 159 ret = -EBUSY;
160 goto out; 160 goto out;
diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h
index 91e2317f4be2..7849d8f2128c 100644
--- a/drivers/thermal/samsung/exynos_tmu.h
+++ b/drivers/thermal/samsung/exynos_tmu.h
@@ -83,7 +83,6 @@ enum soc_type {
83 * @therm_trip_mode_shift: shift bits of tripping mode in tmu_ctrl register. 83 * @therm_trip_mode_shift: shift bits of tripping mode in tmu_ctrl register.
84 * @therm_trip_mode_mask: mask bits of tripping mode in tmu_ctrl register. 84 * @therm_trip_mode_mask: mask bits of tripping mode in tmu_ctrl register.
85 * @therm_trip_en_shift: shift bits of tripping enable in tmu_ctrl register. 85 * @therm_trip_en_shift: shift bits of tripping enable in tmu_ctrl register.
86 * @tmu_status: register drescribing the TMU status.
87 * @tmu_cur_temp: register containing the current temperature of the TMU. 86 * @tmu_cur_temp: register containing the current temperature of the TMU.
88 * @threshold_temp: register containing the base threshold level. 87 * @threshold_temp: register containing the base threshold level.
89 * @threshold_th0: Register containing first set of rising levels. 88 * @threshold_th0: Register containing first set of rising levels.
@@ -115,8 +114,6 @@ struct exynos_tmu_registers {
115 u32 therm_trip_mode_mask; 114 u32 therm_trip_mode_mask;
116 u32 therm_trip_en_shift; 115 u32 therm_trip_en_shift;
117 116
118 u32 tmu_status;
119
120 u32 tmu_cur_temp; 117 u32 tmu_cur_temp;
121 118
122 u32 threshold_temp; 119 u32 threshold_temp;
diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c
index a6088fffb169..49c814299bd9 100644
--- a/drivers/thermal/samsung/exynos_tmu_data.c
+++ b/drivers/thermal/samsung/exynos_tmu_data.c
@@ -27,7 +27,6 @@
27#if defined(CONFIG_CPU_EXYNOS4210) 27#if defined(CONFIG_CPU_EXYNOS4210)
28static const struct exynos_tmu_registers exynos4210_tmu_registers = { 28static const struct exynos_tmu_registers exynos4210_tmu_registers = {
29 .tmu_ctrl = EXYNOS_TMU_REG_CONTROL, 29 .tmu_ctrl = EXYNOS_TMU_REG_CONTROL,
30 .tmu_status = EXYNOS_TMU_REG_STATUS,
31 .tmu_cur_temp = EXYNOS_TMU_REG_CURRENT_TEMP, 30 .tmu_cur_temp = EXYNOS_TMU_REG_CURRENT_TEMP,
32 .threshold_temp = EXYNOS4210_TMU_REG_THRESHOLD_TEMP, 31 .threshold_temp = EXYNOS4210_TMU_REG_THRESHOLD_TEMP,
33 .threshold_th0 = EXYNOS4210_TMU_REG_TRIG_LEVEL0, 32 .threshold_th0 = EXYNOS4210_TMU_REG_TRIG_LEVEL0,
@@ -92,7 +91,6 @@ static const struct exynos_tmu_registers exynos3250_tmu_registers = {
92 .therm_trip_mode_shift = EXYNOS_TMU_TRIP_MODE_SHIFT, 91 .therm_trip_mode_shift = EXYNOS_TMU_TRIP_MODE_SHIFT,
93 .therm_trip_mode_mask = EXYNOS_TMU_TRIP_MODE_MASK, 92 .therm_trip_mode_mask = EXYNOS_TMU_TRIP_MODE_MASK,
94 .therm_trip_en_shift = EXYNOS_TMU_THERM_TRIP_EN_SHIFT, 93 .therm_trip_en_shift = EXYNOS_TMU_THERM_TRIP_EN_SHIFT,
95 .tmu_status = EXYNOS_TMU_REG_STATUS,
96 .tmu_cur_temp = EXYNOS_TMU_REG_CURRENT_TEMP, 94 .tmu_cur_temp = EXYNOS_TMU_REG_CURRENT_TEMP,
97 .threshold_th0 = EXYNOS_THD_TEMP_RISE, 95 .threshold_th0 = EXYNOS_THD_TEMP_RISE,
98 .threshold_th1 = EXYNOS_THD_TEMP_FALL, 96 .threshold_th1 = EXYNOS_THD_TEMP_FALL,
@@ -173,7 +171,6 @@ static const struct exynos_tmu_registers exynos4412_tmu_registers = {
173 .therm_trip_mode_shift = EXYNOS_TMU_TRIP_MODE_SHIFT, 171 .therm_trip_mode_shift = EXYNOS_TMU_TRIP_MODE_SHIFT,
174 .therm_trip_mode_mask = EXYNOS_TMU_TRIP_MODE_MASK, 172 .therm_trip_mode_mask = EXYNOS_TMU_TRIP_MODE_MASK,
175 .therm_trip_en_shift = EXYNOS_TMU_THERM_TRIP_EN_SHIFT, 173 .therm_trip_en_shift = EXYNOS_TMU_THERM_TRIP_EN_SHIFT,
176 .tmu_status = EXYNOS_TMU_REG_STATUS,
177 .tmu_cur_temp = EXYNOS_TMU_REG_CURRENT_TEMP, 174 .tmu_cur_temp = EXYNOS_TMU_REG_CURRENT_TEMP,
178 .threshold_th0 = EXYNOS_THD_TEMP_RISE, 175 .threshold_th0 = EXYNOS_THD_TEMP_RISE,
179 .threshold_th1 = EXYNOS_THD_TEMP_FALL, 176 .threshold_th1 = EXYNOS_THD_TEMP_FALL,
@@ -263,7 +260,6 @@ static const struct exynos_tmu_registers exynos5260_tmu_registers = {
263 .therm_trip_mode_shift = EXYNOS_TMU_TRIP_MODE_SHIFT, 260 .therm_trip_mode_shift = EXYNOS_TMU_TRIP_MODE_SHIFT,
264 .therm_trip_mode_mask = EXYNOS_TMU_TRIP_MODE_MASK, 261 .therm_trip_mode_mask = EXYNOS_TMU_TRIP_MODE_MASK,
265 .therm_trip_en_shift = EXYNOS_TMU_THERM_TRIP_EN_SHIFT, 262 .therm_trip_en_shift = EXYNOS_TMU_THERM_TRIP_EN_SHIFT,
266 .tmu_status = EXYNOS_TMU_REG_STATUS,
267 .tmu_cur_temp = EXYNOS_TMU_REG_CURRENT_TEMP, 263 .tmu_cur_temp = EXYNOS_TMU_REG_CURRENT_TEMP,
268 .threshold_th0 = EXYNOS_THD_TEMP_RISE, 264 .threshold_th0 = EXYNOS_THD_TEMP_RISE,
269 .threshold_th1 = EXYNOS_THD_TEMP_FALL, 265 .threshold_th1 = EXYNOS_THD_TEMP_FALL,
@@ -341,7 +337,6 @@ static const struct exynos_tmu_registers exynos5420_tmu_registers = {
341 .therm_trip_mode_shift = EXYNOS_TMU_TRIP_MODE_SHIFT, 337 .therm_trip_mode_shift = EXYNOS_TMU_TRIP_MODE_SHIFT,
342 .therm_trip_mode_mask = EXYNOS_TMU_TRIP_MODE_MASK, 338 .therm_trip_mode_mask = EXYNOS_TMU_TRIP_MODE_MASK,
343 .therm_trip_en_shift = EXYNOS_TMU_THERM_TRIP_EN_SHIFT, 339 .therm_trip_en_shift = EXYNOS_TMU_THERM_TRIP_EN_SHIFT,
344 .tmu_status = EXYNOS_TMU_REG_STATUS,
345 .tmu_cur_temp = EXYNOS_TMU_REG_CURRENT_TEMP, 340 .tmu_cur_temp = EXYNOS_TMU_REG_CURRENT_TEMP,
346 .threshold_th0 = EXYNOS_THD_TEMP_RISE, 341 .threshold_th0 = EXYNOS_THD_TEMP_RISE,
347 .threshold_th1 = EXYNOS_THD_TEMP_FALL, 342 .threshold_th1 = EXYNOS_THD_TEMP_FALL,
@@ -427,7 +422,6 @@ static const struct exynos_tmu_registers exynos5440_tmu_registers = {
427 .therm_trip_mode_shift = EXYNOS_TMU_TRIP_MODE_SHIFT, 422 .therm_trip_mode_shift = EXYNOS_TMU_TRIP_MODE_SHIFT,
428 .therm_trip_mode_mask = EXYNOS_TMU_TRIP_MODE_MASK, 423 .therm_trip_mode_mask = EXYNOS_TMU_TRIP_MODE_MASK,
429 .therm_trip_en_shift = EXYNOS_TMU_THERM_TRIP_EN_SHIFT, 424 .therm_trip_en_shift = EXYNOS_TMU_THERM_TRIP_EN_SHIFT,
430 .tmu_status = EXYNOS5440_TMU_S0_7_STATUS,
431 .tmu_cur_temp = EXYNOS5440_TMU_S0_7_TEMP, 425 .tmu_cur_temp = EXYNOS5440_TMU_S0_7_TEMP,
432 .threshold_th0 = EXYNOS5440_TMU_S0_7_TH0, 426 .threshold_th0 = EXYNOS5440_TMU_S0_7_TH0,
433 .threshold_th1 = EXYNOS5440_TMU_S0_7_TH1, 427 .threshold_th1 = EXYNOS5440_TMU_S0_7_TH1,
diff --git a/drivers/thermal/samsung/exynos_tmu_data.h b/drivers/thermal/samsung/exynos_tmu_data.h
index 63de598c9c2c..e02ef992f71e 100644
--- a/drivers/thermal/samsung/exynos_tmu_data.h
+++ b/drivers/thermal/samsung/exynos_tmu_data.h
@@ -88,7 +88,6 @@
88#define EXYNOS5440_TMU_S0_7_TRIM 0x000 88#define EXYNOS5440_TMU_S0_7_TRIM 0x000
89#define EXYNOS5440_TMU_S0_7_CTRL 0x020 89#define EXYNOS5440_TMU_S0_7_CTRL 0x020
90#define EXYNOS5440_TMU_S0_7_DEBUG 0x040 90#define EXYNOS5440_TMU_S0_7_DEBUG 0x040
91#define EXYNOS5440_TMU_S0_7_STATUS 0x060
92#define EXYNOS5440_TMU_S0_7_TEMP 0x0f0 91#define EXYNOS5440_TMU_S0_7_TEMP 0x0f0
93#define EXYNOS5440_TMU_S0_7_TH0 0x110 92#define EXYNOS5440_TMU_S0_7_TH0 0x110
94#define EXYNOS5440_TMU_S0_7_TH1 0x130 93#define EXYNOS5440_TMU_S0_7_TH1 0x130