2 * exynos_tmu.h - Samsung EXYNOS TMU (Thermal Management Unit)
4 * Copyright (C) 2011 Samsung Electronics
5 * Donggeun Kim <dg77.kim@samsung.com>
6 * Amit Daniel Kachhap <amit.daniel@samsung.com>
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.
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.
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
25 #include <linux/cpu_cooling.h>
27 #include "exynos_thermal_common.h"
29 enum calibration_type {
30 TYPE_ONE_POINT_TRIMMING,
31 TYPE_ONE_POINT_TRIMMING_25,
32 TYPE_ONE_POINT_TRIMMING_85,
33 TYPE_TWO_POINT_TRIMMING,
38 SOC_ARCH_EXYNOS3250 = 1,
44 SOC_ARCH_EXYNOS5420_TRIMINFO,
49 * struct exynos_tmu_platform_data
50 * @threshold: basic temperature for generating interrupt
51 * 25 <= threshold <= 125 [unit: degree Celsius]
52 * @threshold_falling: differntial value for setting threshold
53 * of temperature falling interrupt.
54 * @trigger_levels: array for each interrupt levels
55 * [unit: degree Celsius]
56 * 0: temperature for trigger_level0 interrupt
57 * condition for trigger_level0 interrupt:
58 * current temperature > threshold + trigger_levels[0]
59 * 1: temperature for trigger_level1 interrupt
60 * condition for trigger_level1 interrupt:
61 * current temperature > threshold + trigger_levels[1]
62 * 2: temperature for trigger_level2 interrupt
63 * condition for trigger_level2 interrupt:
64 * current temperature > threshold + trigger_levels[2]
65 * 3: temperature for trigger_level3 interrupt
66 * condition for trigger_level3 interrupt:
67 * current temperature > threshold + trigger_levels[3]
68 * @trigger_type: defines the type of trigger. Possible values are,
69 * THROTTLE_ACTIVE trigger type
70 * THROTTLE_PASSIVE trigger type
71 * SW_TRIP trigger type
73 * @trigger_enable[]: array to denote which trigger levels are enabled.
74 * 1 = enable trigger_level[] interrupt,
75 * 0 = disable trigger_level[] interrupt
76 * @max_trigger_level: max trigger level supported by the TMU
77 * @non_hw_trigger_levels: number of defined non-hardware trigger levels
78 * @gain: gain of amplifier in the positive-TC generator block
80 * @reference_voltage: reference voltage of amplifier
81 * in the positive-TC generator block
82 * 0 < reference_voltage <= 31
83 * @noise_cancel_mode: noise cancellation mode
84 * 000, 100, 101, 110 and 111 can be different modes
85 * @type: determines the type of SOC
86 * @efuse_value: platform defined fuse value
87 * @min_efuse_value: minimum valid trimming data
88 * @max_efuse_value: maximum valid trimming data
89 * @first_point_trim: temp value of the first point trimming
90 * @second_point_trim: temp value of the second point trimming
91 * @default_temp_offset: default temperature offset in case of no trimming
92 * @cal_type: calibration type for temperature
93 * @freq_clip_table: Table representing frequency reduction percentage.
94 * @freq_tab_count: Count of the above table as frequency reduction may
95 * applicable to only some of the trigger levels.
97 * This structure is required for configuration of exynos_tmu driver.
99 struct exynos_tmu_platform_data {
101 u8 threshold_falling;
102 u8 trigger_levels[MAX_TRIP_COUNT];
103 enum trigger_type trigger_type[MAX_TRIP_COUNT];
104 bool trigger_enable[MAX_TRIP_COUNT];
105 u8 max_trigger_level;
106 u8 non_hw_trigger_levels;
108 u8 reference_voltage;
109 u8 noise_cancel_mode;
115 u8 second_point_trim;
116 u8 default_temp_offset;
118 enum calibration_type cal_type;
120 struct freq_clip_table freq_tab[4];
121 unsigned int freq_tab_count;
125 * struct exynos_tmu_init_data
126 * @tmu_count: number of TMU instances.
127 * @tmu_data: platform data of all TMU instances.
128 * This structure is required to store data for multi-instance exynos tmu
131 struct exynos_tmu_init_data {
133 struct exynos_tmu_platform_data tmu_data[];
136 extern struct exynos_tmu_init_data const exynos3250_default_tmu_data;
137 extern struct exynos_tmu_init_data const exynos4210_default_tmu_data;
138 extern struct exynos_tmu_init_data const exynos4412_default_tmu_data;
139 extern struct exynos_tmu_init_data const exynos5250_default_tmu_data;
140 extern struct exynos_tmu_init_data const exynos5260_default_tmu_data;
141 extern struct exynos_tmu_init_data const exynos5420_default_tmu_data;
142 extern struct exynos_tmu_init_data const exynos5440_default_tmu_data;
144 #endif /* _EXYNOS_TMU_H */