diff options
author | Amit Daniel Kachhap <amit.daniel@samsung.com> | 2013-06-24 06:50:27 -0400 |
---|---|---|
committer | Eduardo Valentin <eduardo.valentin@ti.com> | 2013-08-13 09:52:00 -0400 |
commit | 0c1836a6563decc6de8622b2ed71523b3bdceb65 (patch) | |
tree | 9f879acd6f76db5a5d574fc8ba9b8c70fd3403c5 /drivers/thermal/samsung | |
parent | 59dfa54c5edf4955e6e5469fd7cb8c0a5a813818 (diff) |
thermal: exynos: Move exynos_thermal.h from include/* to driver/* folder
This patch renames and moves include/linux/platform_data/exynos_thermal.h to
drivers/thermal/samsung/exynos_tmu.h. This file movement is needed as exynos
SOC's are not supporting non-DT based platforms and this file now just contains
exynos tmu driver related definations.
Also struct freq_clip_table is now moved to exynos_thermal_common.c as it fixes
the compilation issue occuring because now this new tmu header file is included
in tmu driver c file and not in the common thermal header file.
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/samsung')
-rw-r--r-- | drivers/thermal/samsung/exynos_thermal_common.c | 1 | ||||
-rw-r--r-- | drivers/thermal/samsung/exynos_thermal_common.h | 16 | ||||
-rw-r--r-- | drivers/thermal/samsung/exynos_tmu.c | 2 | ||||
-rw-r--r-- | drivers/thermal/samsung/exynos_tmu.h | 107 |
4 files changed, 124 insertions, 2 deletions
diff --git a/drivers/thermal/samsung/exynos_thermal_common.c b/drivers/thermal/samsung/exynos_thermal_common.c index f20f458be0a0..c9edc307dcf3 100644 --- a/drivers/thermal/samsung/exynos_thermal_common.c +++ b/drivers/thermal/samsung/exynos_thermal_common.c | |||
@@ -22,7 +22,6 @@ | |||
22 | 22 | ||
23 | #include <linux/cpu_cooling.h> | 23 | #include <linux/cpu_cooling.h> |
24 | #include <linux/err.h> | 24 | #include <linux/err.h> |
25 | #include <linux/platform_data/exynos_thermal.h> | ||
26 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
27 | #include <linux/thermal.h> | 26 | #include <linux/thermal.h> |
28 | 27 | ||
diff --git a/drivers/thermal/samsung/exynos_thermal_common.h b/drivers/thermal/samsung/exynos_thermal_common.h index 8df18486078c..57ce33b39b54 100644 --- a/drivers/thermal/samsung/exynos_thermal_common.h +++ b/drivers/thermal/samsung/exynos_thermal_common.h | |||
@@ -44,6 +44,22 @@ | |||
44 | 44 | ||
45 | #define EXYNOS_ZONE_COUNT 3 | 45 | #define EXYNOS_ZONE_COUNT 3 |
46 | 46 | ||
47 | /** | ||
48 | * struct freq_clip_table | ||
49 | * @freq_clip_max: maximum frequency allowed for this cooling state. | ||
50 | * @temp_level: Temperature level at which the temperature clipping will | ||
51 | * happen. | ||
52 | * @mask_val: cpumask of the allowed cpu's where the clipping will take place. | ||
53 | * | ||
54 | * This structure is required to be filled and passed to the | ||
55 | * cpufreq_cooling_unregister function. | ||
56 | */ | ||
57 | struct freq_clip_table { | ||
58 | unsigned int freq_clip_max; | ||
59 | unsigned int temp_level; | ||
60 | const struct cpumask *mask_val; | ||
61 | }; | ||
62 | |||
47 | struct thermal_trip_point_conf { | 63 | struct thermal_trip_point_conf { |
48 | int trip_val[MAX_TRIP_COUNT]; | 64 | int trip_val[MAX_TRIP_COUNT]; |
49 | int trip_count; | 65 | int trip_count; |
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 2b2cc333cd7d..568c31d0d1cb 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c | |||
@@ -27,9 +27,9 @@ | |||
27 | #include <linux/module.h> | 27 | #include <linux/module.h> |
28 | #include <linux/of.h> | 28 | #include <linux/of.h> |
29 | #include <linux/platform_device.h> | 29 | #include <linux/platform_device.h> |
30 | #include <linux/platform_data/exynos_thermal.h> | ||
31 | 30 | ||
32 | #include "exynos_thermal_common.h" | 31 | #include "exynos_thermal_common.h" |
32 | #include "exynos_tmu.h" | ||
33 | 33 | ||
34 | /* Exynos generic registers */ | 34 | /* Exynos generic registers */ |
35 | #define EXYNOS_TMU_REG_TRIMINFO 0x0 | 35 | #define EXYNOS_TMU_REG_TRIMINFO 0x0 |
diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h new file mode 100644 index 000000000000..1857609518f2 --- /dev/null +++ b/drivers/thermal/samsung/exynos_tmu.h | |||
@@ -0,0 +1,107 @@ | |||
1 | /* | ||
2 | * exynos_tmu.h - Samsung EXYNOS TMU (Thermal Management Unit) | ||
3 | * | ||
4 | * Copyright (C) 2011 Samsung Electronics | ||
5 | * Donggeun Kim <dg77.kim@samsung.com> | ||
6 | * Amit Daniel Kachhap <amit.daniel@samsung.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef _EXYNOS_TMU_H | ||
24 | #define _EXYNOS_TMU_H | ||
25 | #include <linux/cpu_cooling.h> | ||
26 | |||
27 | #include "exynos_thermal_common.h" | ||
28 | |||
29 | enum calibration_type { | ||
30 | TYPE_ONE_POINT_TRIMMING, | ||
31 | TYPE_TWO_POINT_TRIMMING, | ||
32 | TYPE_NONE, | ||
33 | }; | ||
34 | |||
35 | enum soc_type { | ||
36 | SOC_ARCH_EXYNOS4210 = 1, | ||
37 | SOC_ARCH_EXYNOS, | ||
38 | }; | ||
39 | |||
40 | /** | ||
41 | * struct exynos_tmu_platform_data | ||
42 | * @threshold: basic temperature for generating interrupt | ||
43 | * 25 <= threshold <= 125 [unit: degree Celsius] | ||
44 | * @threshold_falling: differntial value for setting threshold | ||
45 | * of temperature falling interrupt. | ||
46 | * @trigger_levels: array for each interrupt levels | ||
47 | * [unit: degree Celsius] | ||
48 | * 0: temperature for trigger_level0 interrupt | ||
49 | * condition for trigger_level0 interrupt: | ||
50 | * current temperature > threshold + trigger_levels[0] | ||
51 | * 1: temperature for trigger_level1 interrupt | ||
52 | * condition for trigger_level1 interrupt: | ||
53 | * current temperature > threshold + trigger_levels[1] | ||
54 | * 2: temperature for trigger_level2 interrupt | ||
55 | * condition for trigger_level2 interrupt: | ||
56 | * current temperature > threshold + trigger_levels[2] | ||
57 | * 3: temperature for trigger_level3 interrupt | ||
58 | * condition for trigger_level3 interrupt: | ||
59 | * current temperature > threshold + trigger_levels[3] | ||
60 | * @trigger_level0_en: | ||
61 | * 1 = enable trigger_level0 interrupt, | ||
62 | * 0 = disable trigger_level0 interrupt | ||
63 | * @trigger_level1_en: | ||
64 | * 1 = enable trigger_level1 interrupt, | ||
65 | * 0 = disable trigger_level1 interrupt | ||
66 | * @trigger_level2_en: | ||
67 | * 1 = enable trigger_level2 interrupt, | ||
68 | * 0 = disable trigger_level2 interrupt | ||
69 | * @trigger_level3_en: | ||
70 | * 1 = enable trigger_level3 interrupt, | ||
71 | * 0 = disable trigger_level3 interrupt | ||
72 | * @gain: gain of amplifier in the positive-TC generator block | ||
73 | * 0 <= gain <= 15 | ||
74 | * @reference_voltage: reference voltage of amplifier | ||
75 | * in the positive-TC generator block | ||
76 | * 0 <= reference_voltage <= 31 | ||
77 | * @noise_cancel_mode: noise cancellation mode | ||
78 | * 000, 100, 101, 110 and 111 can be different modes | ||
79 | * @type: determines the type of SOC | ||
80 | * @efuse_value: platform defined fuse value | ||
81 | * @cal_type: calibration type for temperature | ||
82 | * @freq_clip_table: Table representing frequency reduction percentage. | ||
83 | * @freq_tab_count: Count of the above table as frequency reduction may | ||
84 | * applicable to only some of the trigger levels. | ||
85 | * | ||
86 | * This structure is required for configuration of exynos_tmu driver. | ||
87 | */ | ||
88 | struct exynos_tmu_platform_data { | ||
89 | u8 threshold; | ||
90 | u8 threshold_falling; | ||
91 | u8 trigger_levels[4]; | ||
92 | bool trigger_level0_en; | ||
93 | bool trigger_level1_en; | ||
94 | bool trigger_level2_en; | ||
95 | bool trigger_level3_en; | ||
96 | |||
97 | u8 gain; | ||
98 | u8 reference_voltage; | ||
99 | u8 noise_cancel_mode; | ||
100 | u32 efuse_value; | ||
101 | |||
102 | enum calibration_type cal_type; | ||
103 | enum soc_type type; | ||
104 | struct freq_clip_table freq_tab[4]; | ||
105 | unsigned int freq_tab_count; | ||
106 | }; | ||
107 | #endif /* _EXYNOS_TMU_H */ | ||