diff options
| author | Lukasz Majewski <l.majewski@samsung.com> | 2013-10-09 02:29:51 -0400 |
|---|---|---|
| committer | Eduardo Valentin <eduardo.valentin@ti.com> | 2013-10-15 10:10:42 -0400 |
| commit | 14ddfaecc8ef462b24c96cf37dad7914fea09358 (patch) | |
| tree | dce33a09480bf7818c2d8fe9f5b66909c92cf8a5 | |
| parent | acecdb3cf42576431ba17d82fcc7b221e63a8d8c (diff) | |
thermal: exynos: Provide separate TMU data for Exynos4412
Up till now Exynos5250 and Exynos4412 had the same definitions for TMU
data. Following commit changes that, by introducing separate
exynos4412_default_tmu_data structure.
Since Exynos4412 was chronologically first, the corresponding name for
TMU registers and default data was renamed.
Additionally, new SOC_ARCH_EXYNOS4412 type has been defined.
Moreover, the SOC_ARCH_EXYNOS name has been changed to SOC_ARCH_EXYNOS5250.
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
| -rw-r--r-- | drivers/thermal/samsung/exynos_tmu.c | 9 | ||||
| -rw-r--r-- | drivers/thermal/samsung/exynos_tmu.h | 3 | ||||
| -rw-r--r-- | drivers/thermal/samsung/exynos_tmu_data.c | 28 | ||||
| -rw-r--r-- | drivers/thermal/samsung/exynos_tmu_data.h | 9 |
4 files changed, 37 insertions, 12 deletions
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index b43afda8acd1..1312b34281ff 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c | |||
| @@ -488,7 +488,7 @@ static const struct of_device_id exynos_tmu_match[] = { | |||
| 488 | }, | 488 | }, |
| 489 | { | 489 | { |
| 490 | .compatible = "samsung,exynos4412-tmu", | 490 | .compatible = "samsung,exynos4412-tmu", |
| 491 | .data = (void *)EXYNOS5250_TMU_DRV_DATA, | 491 | .data = (void *)EXYNOS4412_TMU_DRV_DATA, |
| 492 | }, | 492 | }, |
| 493 | { | 493 | { |
| 494 | .compatible = "samsung,exynos5250-tmu", | 494 | .compatible = "samsung,exynos5250-tmu", |
| @@ -629,9 +629,10 @@ static int exynos_tmu_probe(struct platform_device *pdev) | |||
| 629 | if (ret) | 629 | if (ret) |
| 630 | return ret; | 630 | return ret; |
| 631 | 631 | ||
| 632 | if (pdata->type == SOC_ARCH_EXYNOS || | 632 | if (pdata->type == SOC_ARCH_EXYNOS4210 || |
| 633 | pdata->type == SOC_ARCH_EXYNOS4210 || | 633 | pdata->type == SOC_ARCH_EXYNOS4412 || |
| 634 | pdata->type == SOC_ARCH_EXYNOS5440) | 634 | pdata->type == SOC_ARCH_EXYNOS5250 || |
| 635 | pdata->type == SOC_ARCH_EXYNOS5440) | ||
| 635 | data->soc = pdata->type; | 636 | data->soc = pdata->type; |
| 636 | else { | 637 | else { |
| 637 | ret = -EINVAL; | 638 | ret = -EINVAL; |
diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h index b364c9eee701..b42ece4523e8 100644 --- a/drivers/thermal/samsung/exynos_tmu.h +++ b/drivers/thermal/samsung/exynos_tmu.h | |||
| @@ -41,7 +41,8 @@ enum calibration_mode { | |||
| 41 | 41 | ||
| 42 | enum soc_type { | 42 | enum soc_type { |
| 43 | SOC_ARCH_EXYNOS4210 = 1, | 43 | SOC_ARCH_EXYNOS4210 = 1, |
| 44 | SOC_ARCH_EXYNOS, | 44 | SOC_ARCH_EXYNOS4412, |
| 45 | SOC_ARCH_EXYNOS5250, | ||
| 45 | SOC_ARCH_EXYNOS5440, | 46 | SOC_ARCH_EXYNOS5440, |
| 46 | }; | 47 | }; |
| 47 | 48 | ||
diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c index 9002499c1f69..d8de5c1fcf84 100644 --- a/drivers/thermal/samsung/exynos_tmu_data.c +++ b/drivers/thermal/samsung/exynos_tmu_data.c | |||
| @@ -90,8 +90,8 @@ struct exynos_tmu_init_data const exynos4210_default_tmu_data = { | |||
| 90 | }; | 90 | }; |
| 91 | #endif | 91 | #endif |
| 92 | 92 | ||
| 93 | #if defined(CONFIG_SOC_EXYNOS5250) || defined(CONFIG_SOC_EXYNOS4412) | 93 | #if defined(CONFIG_SOC_EXYNOS4412) || defined(CONFIG_SOC_EXYNOS5250) |
| 94 | static const struct exynos_tmu_registers exynos5250_tmu_registers = { | 94 | static const struct exynos_tmu_registers exynos4412_tmu_registers = { |
| 95 | .triminfo_data = EXYNOS_TMU_REG_TRIMINFO, | 95 | .triminfo_data = EXYNOS_TMU_REG_TRIMINFO, |
| 96 | .triminfo_25_shift = EXYNOS_TRIMINFO_25_SHIFT, | 96 | .triminfo_25_shift = EXYNOS_TRIMINFO_25_SHIFT, |
| 97 | .triminfo_85_shift = EXYNOS_TRIMINFO_85_SHIFT, | 97 | .triminfo_85_shift = EXYNOS_TRIMINFO_85_SHIFT, |
| @@ -128,7 +128,7 @@ static const struct exynos_tmu_registers exynos5250_tmu_registers = { | |||
| 128 | .emul_time_mask = EXYNOS_EMUL_TIME_MASK, | 128 | .emul_time_mask = EXYNOS_EMUL_TIME_MASK, |
| 129 | }; | 129 | }; |
| 130 | 130 | ||
| 131 | #define EXYNOS5250_TMU_DATA \ | 131 | #define EXYNOS4412_TMU_DATA \ |
| 132 | .threshold_falling = 10, \ | 132 | .threshold_falling = 10, \ |
| 133 | .trigger_levels[0] = 85, \ | 133 | .trigger_levels[0] = 85, \ |
| 134 | .trigger_levels[1] = 103, \ | 134 | .trigger_levels[1] = 103, \ |
| @@ -162,15 +162,31 @@ static const struct exynos_tmu_registers exynos5250_tmu_registers = { | |||
| 162 | .temp_level = 103, \ | 162 | .temp_level = 103, \ |
| 163 | }, \ | 163 | }, \ |
| 164 | .freq_tab_count = 2, \ | 164 | .freq_tab_count = 2, \ |
| 165 | .type = SOC_ARCH_EXYNOS, \ | 165 | .registers = &exynos4412_tmu_registers, \ |
| 166 | .registers = &exynos5250_tmu_registers, \ | ||
| 167 | .features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_TRIM_RELOAD | \ | 166 | .features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_TRIM_RELOAD | \ |
| 168 | TMU_SUPPORT_FALLING_TRIP | TMU_SUPPORT_READY_STATUS | \ | 167 | TMU_SUPPORT_FALLING_TRIP | TMU_SUPPORT_READY_STATUS | \ |
| 169 | TMU_SUPPORT_EMUL_TIME) | 168 | TMU_SUPPORT_EMUL_TIME) |
| 169 | #endif | ||
| 170 | 170 | ||
| 171 | #if defined(CONFIG_SOC_EXYNOS4412) | ||
| 172 | struct exynos_tmu_init_data const exynos4412_default_tmu_data = { | ||
| 173 | .tmu_data = { | ||
| 174 | { | ||
| 175 | EXYNOS4412_TMU_DATA, | ||
| 176 | .type = SOC_ARCH_EXYNOS4412, | ||
| 177 | }, | ||
| 178 | }, | ||
| 179 | .tmu_count = 1, | ||
| 180 | }; | ||
| 181 | #endif | ||
| 182 | |||
| 183 | #if defined(CONFIG_SOC_EXYNOS5250) | ||
| 171 | struct exynos_tmu_init_data const exynos5250_default_tmu_data = { | 184 | struct exynos_tmu_init_data const exynos5250_default_tmu_data = { |
| 172 | .tmu_data = { | 185 | .tmu_data = { |
| 173 | { EXYNOS5250_TMU_DATA }, | 186 | { |
| 187 | EXYNOS4412_TMU_DATA, | ||
| 188 | .type = SOC_ARCH_EXYNOS5250, | ||
| 189 | }, | ||
| 174 | }, | 190 | }, |
| 175 | .tmu_count = 1, | 191 | .tmu_count = 1, |
| 176 | }; | 192 | }; |
diff --git a/drivers/thermal/samsung/exynos_tmu_data.h b/drivers/thermal/samsung/exynos_tmu_data.h index dc7feb51099b..b130b1e5f525 100644 --- a/drivers/thermal/samsung/exynos_tmu_data.h +++ b/drivers/thermal/samsung/exynos_tmu_data.h | |||
| @@ -138,7 +138,14 @@ extern struct exynos_tmu_init_data const exynos4210_default_tmu_data; | |||
| 138 | #define EXYNOS4210_TMU_DRV_DATA (NULL) | 138 | #define EXYNOS4210_TMU_DRV_DATA (NULL) |
| 139 | #endif | 139 | #endif |
| 140 | 140 | ||
| 141 | #if (defined(CONFIG_SOC_EXYNOS5250) || defined(CONFIG_SOC_EXYNOS4412)) | 141 | #if defined(CONFIG_SOC_EXYNOS4412) |
| 142 | extern struct exynos_tmu_init_data const exynos4412_default_tmu_data; | ||
| 143 | #define EXYNOS4412_TMU_DRV_DATA (&exynos4412_default_tmu_data) | ||
| 144 | #else | ||
| 145 | #define EXYNOS4412_TMU_DRV_DATA (NULL) | ||
| 146 | #endif | ||
| 147 | |||
| 148 | #if defined(CONFIG_SOC_EXYNOS5250) | ||
| 142 | extern struct exynos_tmu_init_data const exynos5250_default_tmu_data; | 149 | extern struct exynos_tmu_init_data const exynos5250_default_tmu_data; |
| 143 | #define EXYNOS5250_TMU_DRV_DATA (&exynos5250_default_tmu_data) | 150 | #define EXYNOS5250_TMU_DRV_DATA (&exynos5250_default_tmu_data) |
| 144 | #else | 151 | #else |
