aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/thermal.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/thermal.h')
-rw-r--r--include/linux/thermal.h32
1 files changed, 30 insertions, 2 deletions
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index b268d3cf7ae3..f7e11c7ea7d9 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -25,6 +25,7 @@
25#ifndef __THERMAL_H__ 25#ifndef __THERMAL_H__
26#define __THERMAL_H__ 26#define __THERMAL_H__
27 27
28#include <linux/of.h>
28#include <linux/idr.h> 29#include <linux/idr.h>
29#include <linux/device.h> 30#include <linux/device.h>
30#include <linux/workqueue.h> 31#include <linux/workqueue.h>
@@ -143,6 +144,7 @@ struct thermal_cooling_device {
143 int id; 144 int id;
144 char type[THERMAL_NAME_LENGTH]; 145 char type[THERMAL_NAME_LENGTH];
145 struct device device; 146 struct device device;
147 struct device_node *np;
146 void *devdata; 148 void *devdata;
147 const struct thermal_cooling_device_ops *ops; 149 const struct thermal_cooling_device_ops *ops;
148 bool updated; /* true if the cooling device does not need update */ 150 bool updated; /* true if the cooling device does not need update */
@@ -172,7 +174,7 @@ struct thermal_zone_device {
172 int emul_temperature; 174 int emul_temperature;
173 int passive; 175 int passive;
174 unsigned int forced_passive; 176 unsigned int forced_passive;
175 const struct thermal_zone_device_ops *ops; 177 struct thermal_zone_device_ops *ops;
176 const struct thermal_zone_params *tzp; 178 const struct thermal_zone_params *tzp;
177 struct thermal_governor *governor; 179 struct thermal_governor *governor;
178 struct list_head thermal_instances; 180 struct list_head thermal_instances;
@@ -242,8 +244,31 @@ struct thermal_genl_event {
242}; 244};
243 245
244/* Function declarations */ 246/* Function declarations */
247#ifdef CONFIG_THERMAL_OF
248struct thermal_zone_device *
249thermal_zone_of_sensor_register(struct device *dev, int id,
250 void *data, int (*get_temp)(void *, long *),
251 int (*get_trend)(void *, long *));
252void thermal_zone_of_sensor_unregister(struct device *dev,
253 struct thermal_zone_device *tz);
254#else
255static inline struct thermal_zone_device *
256thermal_zone_of_sensor_register(struct device *dev, int id,
257 void *data, int (*get_temp)(void *, long *),
258 int (*get_trend)(void *, long *))
259{
260 return NULL;
261}
262
263static inline
264void thermal_zone_of_sensor_unregister(struct device *dev,
265 struct thermal_zone_device *tz)
266{
267}
268
269#endif
245struct thermal_zone_device *thermal_zone_device_register(const char *, int, int, 270struct thermal_zone_device *thermal_zone_device_register(const char *, int, int,
246 void *, const struct thermal_zone_device_ops *, 271 void *, struct thermal_zone_device_ops *,
247 const struct thermal_zone_params *, int, int); 272 const struct thermal_zone_params *, int, int);
248void thermal_zone_device_unregister(struct thermal_zone_device *); 273void thermal_zone_device_unregister(struct thermal_zone_device *);
249 274
@@ -256,6 +281,9 @@ void thermal_zone_device_update(struct thermal_zone_device *);
256 281
257struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, 282struct thermal_cooling_device *thermal_cooling_device_register(char *, void *,
258 const struct thermal_cooling_device_ops *); 283 const struct thermal_cooling_device_ops *);
284struct thermal_cooling_device *
285thermal_of_cooling_device_register(struct device_node *np, char *, void *,
286 const struct thermal_cooling_device_ops *);
259void thermal_cooling_device_unregister(struct thermal_cooling_device *); 287void thermal_cooling_device_unregister(struct thermal_cooling_device *);
260struct thermal_zone_device *thermal_zone_get_zone_by_name(const char *name); 288struct thermal_zone_device *thermal_zone_get_zone_by_name(const char *name);
261int thermal_zone_get_temp(struct thermal_zone_device *tz, unsigned long *temp); 289int thermal_zone_get_temp(struct thermal_zone_device *tz, unsigned long *temp);