diff options
Diffstat (limited to 'include/linux/thermal.h')
-rw-r--r-- | include/linux/thermal.h | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index ef90838b36a0..99be7fc79c3b 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h | |||
@@ -289,19 +289,49 @@ struct thermal_genl_event { | |||
289 | enum events event; | 289 | enum events event; |
290 | }; | 290 | }; |
291 | 291 | ||
292 | /** | ||
293 | * struct thermal_zone_of_device_ops - scallbacks for handling DT based zones | ||
294 | * | ||
295 | * Mandatory: | ||
296 | * @get_temp: a pointer to a function that reads the sensor temperature. | ||
297 | * | ||
298 | * Optional: | ||
299 | * @get_trend: a pointer to a function that reads the sensor temperature trend. | ||
300 | * @set_emul_temp: a pointer to a function that sets sensor emulated | ||
301 | * temperature. | ||
302 | */ | ||
303 | struct thermal_zone_of_device_ops { | ||
304 | int (*get_temp)(void *, long *); | ||
305 | int (*get_trend)(void *, long *); | ||
306 | int (*set_emul_temp)(void *, unsigned long); | ||
307 | }; | ||
308 | |||
309 | /** | ||
310 | * struct thermal_trip - representation of a point in temperature domain | ||
311 | * @np: pointer to struct device_node that this trip point was created from | ||
312 | * @temperature: temperature value in miliCelsius | ||
313 | * @hysteresis: relative hysteresis in miliCelsius | ||
314 | * @type: trip point type | ||
315 | */ | ||
316 | |||
317 | struct thermal_trip { | ||
318 | struct device_node *np; | ||
319 | unsigned long int temperature; | ||
320 | unsigned long int hysteresis; | ||
321 | enum thermal_trip_type type; | ||
322 | }; | ||
323 | |||
292 | /* Function declarations */ | 324 | /* Function declarations */ |
293 | #ifdef CONFIG_THERMAL_OF | 325 | #ifdef CONFIG_THERMAL_OF |
294 | struct thermal_zone_device * | 326 | struct thermal_zone_device * |
295 | thermal_zone_of_sensor_register(struct device *dev, int id, | 327 | thermal_zone_of_sensor_register(struct device *dev, int id, void *data, |
296 | void *data, int (*get_temp)(void *, long *), | 328 | const struct thermal_zone_of_device_ops *ops); |
297 | int (*get_trend)(void *, long *)); | ||
298 | void thermal_zone_of_sensor_unregister(struct device *dev, | 329 | void thermal_zone_of_sensor_unregister(struct device *dev, |
299 | struct thermal_zone_device *tz); | 330 | struct thermal_zone_device *tz); |
300 | #else | 331 | #else |
301 | static inline struct thermal_zone_device * | 332 | static inline struct thermal_zone_device * |
302 | thermal_zone_of_sensor_register(struct device *dev, int id, | 333 | thermal_zone_of_sensor_register(struct device *dev, int id, void *data, |
303 | void *data, int (*get_temp)(void *, long *), | 334 | const struct thermal_zone_of_device_ops *ops) |
304 | int (*get_trend)(void *, long *)) | ||
305 | { | 335 | { |
306 | return NULL; | 336 | return NULL; |
307 | } | 337 | } |