aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/thermal
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2014-11-13 10:01:10 -0500
committerEduardo Valentin <edubezval@gmail.com>2014-11-20 09:53:14 -0500
commit1e04ee8053b5f0af6bfab52b86a57de1c13c57ef (patch)
tree36233efd4602140e736aebb59a8db5a28329f569 /drivers/thermal
parent6f02fa18fbff39919f26c228e2e7f1f5b9b211e9 (diff)
thermal: exynos: remove TMU_SUPPORT_TRIM_RELOAD flag
Replace TMU_SUPPORT_TRIM_RELOAD flag check in exynos_tmu_initialize() by an explicit check for a SoC type (only Exynos3250, Exynos4412 and Exynos5250 have TMU_SUPPORT_READY_STATUS flag set in their struct exynos_tmu_init_data instances). Please note that this requires adding separate SoC type for Exynos5420 so it doesn't get mistaken with Exynos5250. This is a preparation for introducing per-SoC type tmu_initialize method. 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>
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/samsung/exynos_tmu.c5
-rw-r--r--drivers/thermal/samsung/exynos_tmu.h10
-rw-r--r--drivers/thermal/samsung/exynos_tmu_data.c10
3 files changed, 13 insertions, 12 deletions
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index 33ee527fd211..e4d75a1a17ae 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -161,7 +161,9 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
161 } 161 }
162 } 162 }
163 163
164 if (TMU_SUPPORTS(pdata, TRIM_RELOAD)) { 164 if (data->soc == SOC_ARCH_EXYNOS3250 ||
165 data->soc == SOC_ARCH_EXYNOS4412 ||
166 data->soc == SOC_ARCH_EXYNOS5250) {
165 if (data->soc == SOC_ARCH_EXYNOS3250) { 167 if (data->soc == SOC_ARCH_EXYNOS3250) {
166 ctrl = readl(data->base + EXYNOS_TMU_TRIMINFO_CON1); 168 ctrl = readl(data->base + EXYNOS_TMU_TRIMINFO_CON1);
167 ctrl |= EXYNOS_TRIMINFO_RELOAD_ENABLE; 169 ctrl |= EXYNOS_TRIMINFO_RELOAD_ENABLE;
@@ -626,6 +628,7 @@ static int exynos_tmu_probe(struct platform_device *pdev)
626 pdata->type == SOC_ARCH_EXYNOS4412 || 628 pdata->type == SOC_ARCH_EXYNOS4412 ||
627 pdata->type == SOC_ARCH_EXYNOS5250 || 629 pdata->type == SOC_ARCH_EXYNOS5250 ||
628 pdata->type == SOC_ARCH_EXYNOS5260 || 630 pdata->type == SOC_ARCH_EXYNOS5260 ||
631 pdata->type == SOC_ARCH_EXYNOS5420 ||
629 pdata->type == SOC_ARCH_EXYNOS5420_TRIMINFO || 632 pdata->type == SOC_ARCH_EXYNOS5420_TRIMINFO ||
630 pdata->type == SOC_ARCH_EXYNOS5440) 633 pdata->type == SOC_ARCH_EXYNOS5440)
631 data->soc = pdata->type; 634 data->soc = pdata->type;
diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h
index d3d92058139e..adecc7ff5b8a 100644
--- a/drivers/thermal/samsung/exynos_tmu.h
+++ b/drivers/thermal/samsung/exynos_tmu.h
@@ -40,6 +40,7 @@ enum soc_type {
40 SOC_ARCH_EXYNOS4412, 40 SOC_ARCH_EXYNOS4412,
41 SOC_ARCH_EXYNOS5250, 41 SOC_ARCH_EXYNOS5250,
42 SOC_ARCH_EXYNOS5260, 42 SOC_ARCH_EXYNOS5260,
43 SOC_ARCH_EXYNOS5420,
43 SOC_ARCH_EXYNOS5420_TRIMINFO, 44 SOC_ARCH_EXYNOS5420_TRIMINFO,
44 SOC_ARCH_EXYNOS5440, 45 SOC_ARCH_EXYNOS5440,
45}; 46};
@@ -50,8 +51,6 @@ enum soc_type {
50 * temperature to the TMU controller. 51 * temperature to the TMU controller.
51 * TMU_SUPPORT_MULTI_INST - This features denotes that the soc 52 * TMU_SUPPORT_MULTI_INST - This features denotes that the soc
52 * has many instances of TMU. 53 * has many instances of TMU.
53 * TMU_SUPPORT_TRIM_RELOAD - This features shows that trimming can
54 * be reloaded.
55 * TMU_SUPPORT_FALLING_TRIP - This features shows that interrupt can 54 * TMU_SUPPORT_FALLING_TRIP - This features shows that interrupt can
56 * be registered for falling trips also. 55 * be registered for falling trips also.
57 * TMU_SUPPORT_EMUL_TIME - This features allows to set next temp emulation 56 * TMU_SUPPORT_EMUL_TIME - This features allows to set next temp emulation
@@ -62,10 +61,9 @@ enum soc_type {
62 */ 61 */
63#define TMU_SUPPORT_EMULATION BIT(0) 62#define TMU_SUPPORT_EMULATION BIT(0)
64#define TMU_SUPPORT_MULTI_INST BIT(1) 63#define TMU_SUPPORT_MULTI_INST BIT(1)
65#define TMU_SUPPORT_TRIM_RELOAD BIT(2) 64#define TMU_SUPPORT_FALLING_TRIP BIT(2)
66#define TMU_SUPPORT_FALLING_TRIP BIT(3) 65#define TMU_SUPPORT_EMUL_TIME BIT(3)
67#define TMU_SUPPORT_EMUL_TIME BIT(4) 66#define TMU_SUPPORT_ADDRESS_MULTIPLE BIT(4)
68#define TMU_SUPPORT_ADDRESS_MULTIPLE BIT(5)
69 67
70#define TMU_SUPPORTS(a, b) (a->features & TMU_SUPPORT_ ## b) 68#define TMU_SUPPORTS(a, b) (a->features & TMU_SUPPORT_ ## b)
71 69
diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c
index c327120046ef..1ed8bdc117a0 100644
--- a/drivers/thermal/samsung/exynos_tmu_data.c
+++ b/drivers/thermal/samsung/exynos_tmu_data.c
@@ -131,8 +131,8 @@ static const struct exynos_tmu_registers exynos3250_tmu_registers = {
131 }, \ 131 }, \
132 .freq_tab_count = 2, \ 132 .freq_tab_count = 2, \
133 .registers = &exynos3250_tmu_registers, \ 133 .registers = &exynos3250_tmu_registers, \
134 .features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_TRIM_RELOAD | \ 134 .features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_FALLING_TRIP | \
135 TMU_SUPPORT_FALLING_TRIP | TMU_SUPPORT_EMUL_TIME) 135 TMU_SUPPORT_EMUL_TIME)
136#endif 136#endif
137 137
138#if defined(CONFIG_SOC_EXYNOS3250) 138#if defined(CONFIG_SOC_EXYNOS3250)
@@ -201,8 +201,8 @@ static const struct exynos_tmu_registers exynos4412_tmu_registers = {
201 }, \ 201 }, \
202 .freq_tab_count = 2, \ 202 .freq_tab_count = 2, \
203 .registers = &exynos4412_tmu_registers, \ 203 .registers = &exynos4412_tmu_registers, \
204 .features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_TRIM_RELOAD | \ 204 .features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_FALLING_TRIP | \
205 TMU_SUPPORT_FALLING_TRIP | TMU_SUPPORT_EMUL_TIME) 205 TMU_SUPPORT_EMUL_TIME)
206#endif 206#endif
207 207
208#if defined(CONFIG_SOC_EXYNOS4412) 208#if defined(CONFIG_SOC_EXYNOS4412)
@@ -359,7 +359,7 @@ static const struct exynos_tmu_registers exynos5420_tmu_registers = {
359 359
360#define EXYNOS5420_TMU_DATA \ 360#define EXYNOS5420_TMU_DATA \
361 __EXYNOS5420_TMU_DATA \ 361 __EXYNOS5420_TMU_DATA \
362 .type = SOC_ARCH_EXYNOS5250, \ 362 .type = SOC_ARCH_EXYNOS5420, \
363 .features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_FALLING_TRIP | \ 363 .features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_FALLING_TRIP | \
364 TMU_SUPPORT_EMUL_TIME) 364 TMU_SUPPORT_EMUL_TIME)
365 365