| | | |
Offset 1, 355 lines modified | Offset 1, 110 lines modified |
1 | /*·SPDX-License-Identifier:·GPL-2.0·*/ | 1 | /*·SPDX-License-Identifier:·GPL-2.0·WITH·Linux-syscall-note·*/ |
| 2 | #ifndef·_UAPI_LINUX_THERMAL_H |
| 3 | #define·_UAPI_LINUX_THERMAL_H |
2 | /* | |
3 | ·*··thermal.h··($Revision:·0·$) | |
4 | ·* | |
5 | ·*··Copyright·(C)·2008··Intel·Corp | |
6 | ·*··Copyright·(C)·2008··Zhang·Rui·<rui.zhang@intel.com> | |
7 | ·*··Copyright·(C)·2008··Sujith·Thomas·<sujith.thomas@intel.com> | |
8 | ·*/ | |
| |
9 | #ifndef·__THERMAL_H__ | |
10 | #define·__THERMAL_H__ | 4 | #define·THERMAL_NAME_LENGTH» 20 |
| 5 | #define·THERMAL_THRESHOLD_WAY_UP»0x1 |
| 6 | #define·THERMAL_THRESHOLD_WAY_DOWN» 0x2 |
| |
| 7 | enum·thermal_device_mode·{ |
| 8 | » THERMAL_DEVICE_DISABLED·=·0, |
| 9 | » THERMAL_DEVICE_ENABLED, |
| 10 | }; |
11 | #include·<linux/of.h> | |
12 | #include·<linux/idr.h> | |
13 | #include·<linux/device.h> | |
14 | #include·<linux/sysfs.h> | |
15 | #include·<linux/workqueue.h> | |
16 | #include·<uapi/linux/thermal.h> | |
| |
17 | /*·invalid·cooling·state·*/ | |
18 | #define·THERMAL_CSTATE_INVALID·-1UL | 11 | enum·thermal_trip_type·{ |
| 12 | » THERMAL_TRIP_ACTIVE·=·0, |
| 13 | » THERMAL_TRIP_PASSIVE, |
| 14 | » THERMAL_TRIP_HOT, |
| 15 | » THERMAL_TRIP_CRITICAL, |
| 16 | }; |
| |
19 | /*·No·upper/lower·limit·requirement·*/ | |
20 | #define·THERMAL_NO_LIMIT»((u32)~0) | 17 | /*·Adding·event·notification·support·elements·*/ |
| 18 | #define·THERMAL_GENL_FAMILY_NAME»»"thermal" |
| 19 | #define·THERMAL_GENL_VERSION» » » 0x02 |
| 20 | #define·THERMAL_GENL_SAMPLING_GROUP_NAME»"sampling" |
| 21 | #define·THERMAL_GENL_EVENT_GROUP_NAME» » "event" |
| |
21 | /*·Default·weight·of·a·bound·cooling·device·*/ | |
22 | #define·THERMAL_WEIGHT_DEFAULT·0 | 22 | /*·Attributes·of·thermal_genl_family·*/ |
| 23 | enum·thermal_genl_attr·{ |
| 24 | » THERMAL_GENL_ATTR_UNSPEC, |
| 25 | » THERMAL_GENL_ATTR_TZ, |
| 26 | » THERMAL_GENL_ATTR_TZ_ID, |
| 27 | » THERMAL_GENL_ATTR_TZ_TEMP, |
| 28 | » THERMAL_GENL_ATTR_TZ_TRIP, |
| 29 | » THERMAL_GENL_ATTR_TZ_TRIP_ID, |
| 30 | » THERMAL_GENL_ATTR_TZ_TRIP_TYPE, |
| 31 | » THERMAL_GENL_ATTR_TZ_TRIP_TEMP, |
| 32 | » THERMAL_GENL_ATTR_TZ_TRIP_HYST, |
| 33 | » THERMAL_GENL_ATTR_TZ_MODE, |
| 34 | » THERMAL_GENL_ATTR_TZ_NAME, |
| 35 | » THERMAL_GENL_ATTR_TZ_CDEV_WEIGHT, |
| 36 | » THERMAL_GENL_ATTR_TZ_GOV, |
| 37 | » THERMAL_GENL_ATTR_TZ_GOV_NAME, |
| 38 | » THERMAL_GENL_ATTR_CDEV, |
| 39 | » THERMAL_GENL_ATTR_CDEV_ID, |
| 40 | » THERMAL_GENL_ATTR_CDEV_CUR_STATE, |
| 41 | » THERMAL_GENL_ATTR_CDEV_MAX_STATE, |
| 42 | » THERMAL_GENL_ATTR_CDEV_NAME, |
| 43 | » THERMAL_GENL_ATTR_GOV_NAME, |
| 44 | » THERMAL_GENL_ATTR_CPU_CAPABILITY, |
| 45 | » THERMAL_GENL_ATTR_CPU_CAPABILITY_ID, |
| 46 | » THERMAL_GENL_ATTR_CPU_CAPABILITY_PERFORMANCE, |
| 47 | » THERMAL_GENL_ATTR_CPU_CAPABILITY_EFFICIENCY, |
| 48 | » THERMAL_GENL_ATTR_THRESHOLD, |
| 49 | » THERMAL_GENL_ATTR_THRESHOLD_TEMP, |
| 50 | » THERMAL_GENL_ATTR_THRESHOLD_DIRECTION, |
| 51 | » THERMAL_GENL_ATTR_TZ_PREV_TEMP, |
| 52 | » __THERMAL_GENL_ATTR_MAX, |
| 53 | }; |
| 54 | #define·THERMAL_GENL_ATTR_MAX·(__THERMAL_GENL_ATTR_MAX·-·1) |
| |
23 | /*·use·value,·which·<·0K,·to·indicate·an·invalid/uninitialized·temperature·*/ | |
24 | #define·THERMAL_TEMP_INVALID» -274000 | 55 | enum·thermal_genl_sampling·{ |
| 56 | » THERMAL_GENL_SAMPLING_TEMP, |
| 57 | » __THERMAL_GENL_SAMPLING_MAX, |
| 58 | }; |
| 59 | #define·THERMAL_GENL_SAMPLING_MAX·(__THERMAL_GENL_SAMPLING_MAX·-·1) |
| |
25 | struct·thermal_zone_device; | |
26 | struct·thermal_cooling_device; | |
27 | struct·thermal_instance; | |
28 | struct·thermal_debugfs; | |
29 | struct·thermal_attr; | 60 | /*·Events·of·thermal_genl_family·*/ |
| 61 | enum·thermal_genl_event·{ |
| 62 | » THERMAL_GENL_EVENT_UNSPEC, |
| 63 | » THERMAL_GENL_EVENT_TZ_CREATE,» » /*·Thermal·zone·creation·*/ |
| 64 | » THERMAL_GENL_EVENT_TZ_DELETE,» » /*·Thermal·zone·deletion·*/ |
| 65 | » THERMAL_GENL_EVENT_TZ_DISABLE,» » /*·Thermal·zone·disabled·*/ |
| 66 | » THERMAL_GENL_EVENT_TZ_ENABLE,» » /*·Thermal·zone·enabled·*/ |
| 67 | » THERMAL_GENL_EVENT_TZ_TRIP_UP,» » /*·Trip·point·crossed·the·way·up·*/ |
| 68 | » THERMAL_GENL_EVENT_TZ_TRIP_DOWN,» /*·Trip·point·crossed·the·way·down·*/ |
| 69 | » THERMAL_GENL_EVENT_TZ_TRIP_CHANGE,» /*·Trip·point·changed·*/ |
| 70 | » THERMAL_GENL_EVENT_TZ_TRIP_ADD,»»/*·Trip·point·added·*/ |
| 71 | » THERMAL_GENL_EVENT_TZ_TRIP_DELETE,» /*·Trip·point·deleted·*/ |
| 72 | » THERMAL_GENL_EVENT_CDEV_ADD,» » /*·Cdev·bound·to·the·thermal·zone·*/ |
| 73 | » THERMAL_GENL_EVENT_CDEV_DELETE,»»/*·Cdev·unbound·*/ |
| 74 | » THERMAL_GENL_EVENT_CDEV_STATE_UPDATE,» /*·Cdev·state·updated·*/ |
| 75 | » THERMAL_GENL_EVENT_TZ_GOV_CHANGE,» /*·Governor·policy·changed··*/ |
| 76 | » THERMAL_GENL_EVENT_CPU_CAPABILITY_CHANGE,» /*·CPU·capability·changed·*/ |
| 77 | » THERMAL_GENL_EVENT_THRESHOLD_ADD,» /*·A·thresold·has·been·added·*/ |
| 78 | » THERMAL_GENL_EVENT_THRESHOLD_DELETE,» /*·A·thresold·has·been·deleted·*/ |
| 79 | » THERMAL_GENL_EVENT_THRESHOLD_FLUSH,» /*·All·thresolds·have·been·deleted·*/ |
| 80 | » THERMAL_GENL_EVENT_THRESHOLD_UP,» /*·A·thresold·has·been·crossed·the·way·up·*/ |
| 81 | » THERMAL_GENL_EVENT_THRESHOLD_DOWN,» /*·A·thresold·has·been·crossed·the·way·down·*/ |
| 82 | » __THERMAL_GENL_EVENT_MAX, |
| 83 | }; |
| 84 | #define·THERMAL_GENL_EVENT_MAX·(__THERMAL_GENL_EVENT_MAX·-·1) |
| |
| 85 | /*·Commands·supported·by·the·thermal_genl_family·*/ |
30 | enum·thermal_trend·{ | 86 | enum·thermal_genl_cmd·{ |
31 | » THERMAL_TREND_STABLE,·/*·temperature·is·stable·*/ | |
32 | » THERMAL_TREND_RAISING,·/*·temperature·is·raising·*/ | |
33 | » THERMAL_TREND_DROPPING,·/*·temperature·is·dropping·*/ | 87 | » THERMAL_GENL_CMD_UNSPEC, |
| 88 | » THERMAL_GENL_CMD_TZ_GET_ID,» » /*·List·of·thermal·zones·id·*/ |
| 89 | » THERMAL_GENL_CMD_TZ_GET_TRIP,» » /*·List·of·thermal·trips·*/ |
| 90 | » THERMAL_GENL_CMD_TZ_GET_TEMP,» » /*·Get·the·thermal·zone·temperature·*/ |
| 91 | » THERMAL_GENL_CMD_TZ_GET_GOV,» » /*·Get·the·thermal·zone·governor·*/ |
| 92 | » THERMAL_GENL_CMD_TZ_GET_MODE,» » /*·Get·the·thermal·zone·mode·*/ |
| 93 | » THERMAL_GENL_CMD_CDEV_GET,» » /*·List·of·cdev·id·*/ |
| 94 | » THERMAL_GENL_CMD_THRESHOLD_GET,»»/*·List·of·thresholds·*/ |
| 95 | » THERMAL_GENL_CMD_THRESHOLD_ADD,»»/*·Add·a·threshold·*/ |
| 96 | » THERMAL_GENL_CMD_THRESHOLD_DELETE,» /*·Delete·a·threshold·*/ |
| 97 | » THERMAL_GENL_CMD_THRESHOLD_FLUSH,» /*·Flush·all·the·thresholds·*/ |
| 98 | » __THERMAL_GENL_CMD_MAX, |
34 | }; | 99 | }; |
| 100 | #define·THERMAL_GENL_CMD_MAX·(__THERMAL_GENL_CMD_MAX·-·1) |
| |
35 | /*·Thermal·notification·reason·*/ | |
36 | enum·thermal_notify_event·{ | |
37 | » THERMAL_EVENT_UNSPECIFIED,·/*·Unspecified·event·*/ | |
38 | » THERMAL_EVENT_TEMP_SAMPLE,·/*·New·Temperature·sample·*/ | |
39 | » THERMAL_TRIP_VIOLATED,·/*·TRIP·Point·violation·*/ | |
40 | » THERMAL_TRIP_CHANGED,·/*·TRIP·Point·temperature·changed·*/ | |
41 | » THERMAL_DEVICE_DOWN,·/*·Thermal·device·is·down·*/ | |
42 | » THERMAL_DEVICE_UP,·/*·Thermal·device·is·up·after·a·down·event·*/ | |
43 | » THERMAL_DEVICE_POWER_CAPABILITY_CHANGED,·/*·power·capability·changed·*/ | |
44 | » THERMAL_TABLE_CHANGED,·/*·Thermal·table(s)·changed·*/ | |
45 | » THERMAL_EVENT_KEEP_ALIVE,·/*·Request·for·user·space·handler·to·respond·*/ | |
46 | » THERMAL_TZ_BIND_CDEV,·/*·Cooling·dev·is·bind·to·the·thermal·zone·*/ | |
47 | » THERMAL_TZ_UNBIND_CDEV,·/*·Cooling·dev·is·unbind·from·the·thermal·zone·*/ | |
48 | » THERMAL_INSTANCE_WEIGHT_CHANGED,·/*·Thermal·instance·weight·changed·*/ | |
49 | » THERMAL_TZ_RESUME,·/*·Thermal·zone·is·resuming·after·system·sleep·*/ | |
50 | » THERMAL_TZ_ADD_THRESHOLD,·/*·Threshold·added·*/ | |
51 | » THERMAL_TZ_DEL_THRESHOLD,·/*·Threshold·deleted·*/ | |
52 | » THERMAL_TZ_FLUSH_THRESHOLDS,·/*·All·thresholds·deleted·*/ | |
53 | }; | |
| |
54 | /** | |
55 | ·*·struct·thermal_trip·-·representation·of·a·point·in·temperature·domain | |
56 | ·*·@temperature:·temperature·value·in·miliCelsius | |
57 | ·*·@hysteresis:·relative·hysteresis·in·miliCelsius | |
58 | ·*·@type:·trip·point·type | |
59 | ·*·@priv:·pointer·to·driver·data·associated·with·this·trip | |
60 | ·*·@flags:·flags·representing·binary·properties·of·the·trip | |
61 | ·*/ | |
62 | struct·thermal_trip·{ | |
63 | » int·temperature; | |
64 | » int·hysteresis; | |
65 | » enum·thermal_trip_type·type; | |
66 | » u8·flags; | |
67 | » void·*priv; | |
68 | }; | |
| |
69 | #define·THERMAL_TRIP_FLAG_RW_TEMP» BIT(0) | |
70 | #define·THERMAL_TRIP_FLAG_RW_HYST» BIT(1) | |
| |
71 | #define·THERMAL_TRIP_FLAG_RW» (THERMAL_TRIP_FLAG_RW_TEMP·|·\ | |
72 | » » » » ·THERMAL_TRIP_FLAG_RW_HYST) | |
| |
73 | #define·THERMAL_TRIP_PRIV_TO_INT(_val_)» (uintptr_t)(_val_) | |
74 | #define·THERMAL_INT_TO_TRIP_PRIV(_val_)» (void·*)(uintptr_t)(_val_) | |
| |
75 | struct·cooling_spec·{ | |
76 | » unsigned·long·upper;» /*·Highest·cooling·state··*/ | |
77 | » unsigned·long·lower;» /*·Lowest·cooling·state··*/ | |
78 | » unsigned·int·weight;» /*·Cooling·device·weight·*/ | |
79 | }; | |
| |
80 | struct·thermal_zone_device_ops·{ | |
81 | » bool·(*should_bind)·(struct·thermal_zone_device·*, | |
82 | » » » ·····const·struct·thermal_trip·*, | |
83 | » » » ·····struct·thermal_cooling_device·*, | |
84 | » » » ·····struct·cooling_spec·*); | |
85 | » int·(*get_temp)·(struct·thermal_zone_device·*,·int·*); | |
86 | » int·(*set_trips)·(struct·thermal_zone_device·*,·int,·int); | |
87 | » int·(*change_mode)·(struct·thermal_zone_device·*, | |
88 | » » enum·thermal_device_mode); | |
89 | » int·(*set_trip_temp)·(struct·thermal_zone_device·*, | |
90 | » » » ······const·struct·thermal_trip·*,·int); | |
91 | » int·(*get_crit_temp)·(struct·thermal_zone_device·*,·int·*); | |
92 | » int·(*set_emul_temp)·(struct·thermal_zone_device·*,·int); | |
93 | » int·(*get_trend)·(struct·thermal_zone_device·*, | |
94 | » » » ··const·struct·thermal_trip·*,·enum·thermal_trend·*); | |
95 | » void·(*hot)(struct·thermal_zone_device·*); | |
96 | » void·(*critical)(struct·thermal_zone_device·*); | |
97 | }; | |
| |
98 | struct·thermal_cooling_device_ops·{ | |
99 | » int·(*get_max_state)·(struct·thermal_cooling_device·*,·unsigned·long·*); | |
100 | » int·(*get_cur_state)·(struct·thermal_cooling_device·*,·unsigned·long·*); | |
101 | » int·(*set_cur_state)·(struct·thermal_cooling_device·*,·unsigned·long); | |
102 | » int·(*get_requested_power)(struct·thermal_cooling_device·*,·u32·*); | |
103 | » int·(*state2power)(struct·thermal_cooling_device·*,·unsigned·long,·u32·*); | |
104 | » int·(*power2state)(struct·thermal_cooling_device·*,·u32,·unsigned·long·*); | |
105 | }; | |
| |
106 | struct·thermal_cooling_device·{ | |
107 | » int·id; | |
108 | » const·char·*type; | |
109 | » unsigned·long·max_state; | |
110 | » struct·device·device; | |
111 | » struct·device_node·*np; | |
112 | » void·*devdata; | |
113 | » void·*stats; | |
114 | » const·struct·thermal_cooling_device_ops·*ops; | |
115 | » bool·updated;·/*·true·if·the·cooling·device·does·not·need·update·*/ | |
116 | » struct·mutex·lock;·/*·protect·thermal_instances·list·*/ | |
117 | » struct·list_head·thermal_instances; | |
118 | » struct·list_head·node; | |
119 | #ifdef·CONFIG_THERMAL_DEBUGFS | |
120 | » struct·thermal_debugfs·*debugfs; | |
121 | #endif | |
122 | }; | |
| |
123 | DEFINE_GUARD(cooling_dev,·struct·thermal_cooling_device·*,·mutex_lock(&_T->lock), | |
124 | » ·····mutex_unlock(&_T->lock)) | |
| |
125 | /*·Structure·to·define·Thermal·Zone·parameters·*/ | |
126 | struct·thermal_zone_params·{ | |
127 | » const·char·*governor_name; | |
| |
128 | » /* | |
129 | » ·*·a·boolean·to·indicate·if·the·thermal·to·hwmon·sysfs·interface | |
130 | » ·*·is·required.·when·no_hwmon·==·false,·a·hwmon·sysfs·interface | |
131 | » ·*·will·be·created.·when·no_hwmon·==·true,·nothing·will·be·done | |
132 | » ·*/ | |
133 | » bool·no_hwmon; | |
| |
134 | » /* | |
135 | » ·*·Sustainable·power·(heat)·that·this·thermal·zone·can·dissipate·in | |
136 | » ·*·mW | |
137 | » ·*/ | |
138 | » u32·sustainable_power; | |
| |
139 | » /* | |
140 | » ·*·Proportional·parameter·of·the·PID·controller·when | |
141 | » ·*·overshooting·(i.e.,·when·temperature·is·below·the·target) | |
142 | » ·*/ | |
143 | » s32·k_po; | |
| |
144 | » /* | |
145 | » ·*·Proportional·parameter·of·the·PID·controller·when | |
146 | » ·*·undershooting | |
147 | » ·*/ | |
148 | » s32·k_pu; | |
| |
149 | » /*·Integral·parameter·of·the·PID·controller·*/ | |
150 | » s32·k_i; | |
| |
151 | » /*·Derivative·parameter·of·the·PID·controller·*/ | |
152 | » s32·k_d; | |
| |
153 | » /*·threshold·below·which·the·error·is·no·longer·accumulated·*/ | |
154 | » s32·integral_cutoff; | |
| |
155 | » /* | |
156 | » ·*·@slope:» slope·of·a·linear·temperature·adjustment·curve. | |
157 | » ·*·» » Used·by·thermal·zone·drivers. | |
158 | » ·*/ | |
159 | » int·slope; | |
160 | » /* | |
161 | » ·*·@offset:» offset·of·a·linear·temperature·adjustment·curve. | |
162 | » ·*·» » Used·by·thermal·zone·drivers·(default·0). | |
163 | » ·*/ | |
164 | » int·offset; | |
165 | }; | |
| |
166 | /*·Function·declarations·*/ | |
167 | #ifdef·CONFIG_THERMAL_OF | |
168 | struct·thermal_zone_device·*devm_thermal_of_zone_register(struct·device·*dev,·int·id,·void·*data, | |
169 | » » » » » » » ··const·struct·thermal_zone_device_ops·*ops); | |
| |
170 | void·devm_thermal_of_zone_unregister(struct·device·*dev,·struct·thermal_zone_device·*tz); | |
| |
171 | #else | |
| |
172 | static·inline | |
173 | struct·thermal_zone_device·*devm_thermal_of_zone_register(struct·device·*dev,·int·id,·void·*data, | |
174 | » » » » » » » ··const·struct·thermal_zone_device_ops·*ops) | |
175 | { | |
176 | » return·ERR_PTR(-ENOTSUPP); | |
177 | } | |
| |
178 | static·inline·void·devm_thermal_of_zone_unregister(struct·device·*dev, | |
179 | » » » » » » ···struct·thermal_zone_device·*tz) | |
180 | { | |
181 | } | |
182 | #endif | |
| |
183 | int·for_each_thermal_trip(struct·thermal_zone_device·*tz, | |
184 | » » » ··int·(*cb)(struct·thermal_trip·*,·void·*), | |
185 | » » » ··void·*data); | |
186 | int·thermal_zone_for_each_trip(struct·thermal_zone_device·*tz, | |
187 | » » » ·······int·(*cb)(struct·thermal_trip·*,·void·*), | |
188 | » » » ·······void·*data); | |
189 | void·thermal_zone_set_trip_temp(struct·thermal_zone_device·*tz, | |
190 | » » » » struct·thermal_trip·*trip,·int·temp); | |
| |
191 | int·thermal_zone_get_crit_temp(struct·thermal_zone_device·*tz,·int·*temp); | |
| |
192 | #ifdef·CONFIG_THERMAL | |
193 | struct·thermal_zone_device·*thermal_zone_device_register_with_trips( | |
194 | » » » » » const·char·*type, | |
195 | » » » » » const·struct·thermal_trip·*trips, | |
196 | » » » » » int·num_trips,·void·*devdata, | |
197 | » » » » » const·struct·thermal_zone_device_ops·*ops, | |
198 | » » » » » const·struct·thermal_zone_params·*tzp, | |
199 | » » » » » unsigned·int·passive_delay, | |
200 | » » » » » unsigned·int·polling_delay); | |
| |
201 | struct·thermal_zone_device·*thermal_tripless_zone_device_register( | |
202 | » » » » » const·char·*type, | |
203 | » » » » » void·*devdata, | |
204 | » » » » » const·struct·thermal_zone_device_ops·*ops, | |
205 | » » » » » const·struct·thermal_zone_params·*tzp); | |
| |
206 | void·thermal_zone_device_unregister(struct·thermal_zone_device·*tz); | |
| |
207 | void·*thermal_zone_device_priv(struct·thermal_zone_device·*tzd); | |
208 | const·char·*thermal_zone_device_type(struct·thermal_zone_device·*tzd); | |
209 | int·thermal_zone_device_id(struct·thermal_zone_device·*tzd); | |
210 | struct·device·*thermal_zone_device(struct·thermal_zone_device·*tzd); | |
| |
211 | void·thermal_zone_device_update(struct·thermal_zone_device·*, | |
212 | » » » » enum·thermal_notify_event); | |
| |
213 | struct·thermal_cooling_device·*thermal_cooling_device_register(const·char·*, | |
214 | » » void·*,·const·struct·thermal_cooling_device_ops·*); | |
215 | struct·thermal_cooling_device·* | |
216 | thermal_of_cooling_device_register(struct·device_node·*np,·const·char·*,·void·*, | |
217 | » » » » ···const·struct·thermal_cooling_device_ops·*); | |
218 | struct·thermal_cooling_device·* | |
219 | devm_thermal_of_cooling_device_register(struct·device·*dev, | |
220 | » » » » struct·device_node·*np, | |
221 | » » » » const·char·*type,·void·*devdata, | |
222 | » » » » const·struct·thermal_cooling_device_ops·*ops); | |
223 | void·thermal_cooling_device_update(struct·thermal_cooling_device·*); | |
224 | void·thermal_cooling_device_unregister(struct·thermal_cooling_device·*); | |
225 | struct·thermal_zone_device·*thermal_zone_get_zone_by_name(const·char·*name); | |
226 | int·thermal_zone_get_temp(struct·thermal_zone_device·*tz,·int·*temp); | |
227 | int·thermal_zone_get_slope(struct·thermal_zone_device·*tz); | |
228 | int·thermal_zone_get_offset(struct·thermal_zone_device·*tz); | |
229 | bool·thermal_trip_is_bound_to_cdev(struct·thermal_zone_device·*tz, | |
230 | » » » » ···const·struct·thermal_trip·*trip, | |
231 | » » » » ···struct·thermal_cooling_device·*cdev); | |
| |
232 | int·thermal_zone_device_enable(struct·thermal_zone_device·*tz); | |
233 | int·thermal_zone_device_disable(struct·thermal_zone_device·*tz); | |
234 | void·thermal_zone_device_critical(struct·thermal_zone_device·*tz); | |
235 | #else | |
236 | static·inline·struct·thermal_zone_device·*thermal_zone_device_register_with_trips( | |
237 | » » » » » const·char·*type, | |
238 | » » » » » const·struct·thermal_trip·*trips, | |
239 | » » » » » int·num_trips,·void·*devdata, | |
240 | » » » » » const·struct·thermal_zone_device_ops·*ops, | |
241 | » » » » » const·struct·thermal_zone_params·*tzp, | |
242 | » » » » » int·passive_delay,·int·polling_delay) | |
243 | {·return·ERR_PTR(-ENODEV);·} | |
| |
244 | static·inline·struct·thermal_zone_device·*thermal_tripless_zone_device_register( | |
245 | » » » » » const·char·*type, | |
246 | » » » » » void·*devdata, | |
247 | » » » » » struct·thermal_zone_device_ops·*ops, | |
248 | » » » » » const·struct·thermal_zone_params·*tzp) | |
249 | {·return·ERR_PTR(-ENODEV);·} | |
| |
250 | static·inline·void·thermal_zone_device_unregister(struct·thermal_zone_device·*tz) | |
251 | {·} | |
| |
252 | static·inline·void·thermal_zone_device_update(struct·thermal_zone_device·*tz, | |
253 | » » » » » ······enum·thermal_notify_event·event) | |
254 | {·} | |
| |
255 | static·inline·struct·thermal_cooling_device·* | |
256 | thermal_cooling_device_register(const·char·*type,·void·*devdata, | |
257 | » const·struct·thermal_cooling_device_ops·*ops) | |
258 | {·return·ERR_PTR(-ENODEV);·} | |
259 | static·inline·struct·thermal_cooling_device·* | |
260 | thermal_of_cooling_device_register(struct·device_node·*np, | |
261 | » const·char·*type,·void·*devdata, | |
262 | » const·struct·thermal_cooling_device_ops·*ops) | |
263 | {·return·ERR_PTR(-ENODEV);·} | |
264 | static·inline·struct·thermal_cooling_device·* | |
265 | devm_thermal_of_cooling_device_register(struct·device·*dev, | |
266 | » » » » struct·device_node·*np, | |
267 | » » » » const·char·*type,·void·*devdata, | |
268 | » » » » const·struct·thermal_cooling_device_ops·*ops) | |
269 | { | |
270 | » return·ERR_PTR(-ENODEV); | |
271 | } | |
272 | static·inline·void·thermal_cooling_device_unregister( | |
273 | » struct·thermal_cooling_device·*cdev) | |
274 | {·} | |
275 | static·inline·struct·thermal_zone_device·*thermal_zone_get_zone_by_name( | |
276 | » » const·char·*name) | |
277 | {·return·ERR_PTR(-ENODEV);·} | |
278 | static·inline·int·thermal_zone_get_temp( | |
279 | » » struct·thermal_zone_device·*tz,·int·*temp) | |
280 | {·return·-ENODEV;·} | |
281 | static·inline·int·thermal_zone_get_slope( | |
282 | » » struct·thermal_zone_device·*tz) | |
283 | {·return·-ENODEV;·} | |
284 | static·inline·int·thermal_zone_get_offset( | |
285 | » » struct·thermal_zone_device·*tz) | |
286 | {·return·-ENODEV;·} | |
| |
287 | static·inline·void·*thermal_zone_device_priv(struct·thermal_zone_device·*tz) | |
288 | { | |
289 | » return·NULL; | |
290 | } | |
| |
291 | static·inline·const·char·*thermal_zone_device_type(struct·thermal_zone_device·*tzd) | |
292 | { | |
293 | » return·NULL; | |
294 | } | |
| |
295 | static·inline·int·thermal_zone_device_id(struct·thermal_zone_device·*tzd) | |
296 | { | |
297 | » return·-ENODEV; | |
298 | } | |
| |
299 | static·inline·int·thermal_zone_device_enable(struct·thermal_zone_device·*tz) | |
300 | {·return·-ENODEV;·} | |
| |
301 | static·inline·int·thermal_zone_device_disable(struct·thermal_zone_device·*tz) | |
302 | {·return·-ENODEV;·} | |
303 | #endif·/*·CONFIG_THERMAL·*/ | |
| |
304 | #endif·/*·__THERMAL_H__·*/ | 101 | #endif·/*·_UAPI_LINUX_THERMAL_H·*/ |