diff options
Diffstat (limited to 'include/linux/thermal.h')
-rw-r--r-- | include/linux/thermal.h | 47 |
1 files changed, 37 insertions, 10 deletions
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 1de8b9eb841b..8651556dbd52 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h | |||
@@ -77,7 +77,7 @@ struct thermal_cooling_device { | |||
77 | char type[THERMAL_NAME_LENGTH]; | 77 | char type[THERMAL_NAME_LENGTH]; |
78 | struct device device; | 78 | struct device device; |
79 | void *devdata; | 79 | void *devdata; |
80 | struct thermal_cooling_device_ops *ops; | 80 | const struct thermal_cooling_device_ops *ops; |
81 | struct list_head node; | 81 | struct list_head node; |
82 | }; | 82 | }; |
83 | 83 | ||
@@ -114,7 +114,7 @@ struct thermal_zone_device { | |||
114 | int last_temperature; | 114 | int last_temperature; |
115 | bool passive; | 115 | bool passive; |
116 | unsigned int forced_passive; | 116 | unsigned int forced_passive; |
117 | struct thermal_zone_device_ops *ops; | 117 | const struct thermal_zone_device_ops *ops; |
118 | struct list_head cooling_devices; | 118 | struct list_head cooling_devices; |
119 | struct idr idr; | 119 | struct idr idr; |
120 | struct mutex lock; /* protect cooling devices list */ | 120 | struct mutex lock; /* protect cooling devices list */ |
@@ -127,13 +127,41 @@ struct thermal_zone_device { | |||
127 | struct thermal_hwmon_attr temp_crit; /* hwmon sys attr */ | 127 | struct thermal_hwmon_attr temp_crit; /* hwmon sys attr */ |
128 | #endif | 128 | #endif |
129 | }; | 129 | }; |
130 | /* Adding event notification support elements */ | ||
131 | #define THERMAL_GENL_FAMILY_NAME "thermal_event" | ||
132 | #define THERMAL_GENL_VERSION 0x01 | ||
133 | #define THERMAL_GENL_MCAST_GROUP_NAME "thermal_mc_group" | ||
134 | |||
135 | enum events { | ||
136 | THERMAL_AUX0, | ||
137 | THERMAL_AUX1, | ||
138 | THERMAL_CRITICAL, | ||
139 | THERMAL_DEV_FAULT, | ||
140 | }; | ||
141 | |||
142 | struct thermal_genl_event { | ||
143 | u32 orig; | ||
144 | enum events event; | ||
145 | }; | ||
146 | /* attributes of thermal_genl_family */ | ||
147 | enum { | ||
148 | THERMAL_GENL_ATTR_UNSPEC, | ||
149 | THERMAL_GENL_ATTR_EVENT, | ||
150 | __THERMAL_GENL_ATTR_MAX, | ||
151 | }; | ||
152 | #define THERMAL_GENL_ATTR_MAX (__THERMAL_GENL_ATTR_MAX - 1) | ||
153 | |||
154 | /* commands supported by the thermal_genl_family */ | ||
155 | enum { | ||
156 | THERMAL_GENL_CMD_UNSPEC, | ||
157 | THERMAL_GENL_CMD_EVENT, | ||
158 | __THERMAL_GENL_CMD_MAX, | ||
159 | }; | ||
160 | #define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1) | ||
130 | 161 | ||
131 | struct thermal_zone_device *thermal_zone_device_register(char *, int, void *, | 162 | struct thermal_zone_device *thermal_zone_device_register(char *, int, void *, |
132 | struct | 163 | const struct thermal_zone_device_ops *, int tc1, int tc2, |
133 | thermal_zone_device_ops | 164 | int passive_freq, int polling_freq); |
134 | *, int tc1, int tc2, | ||
135 | int passive_freq, | ||
136 | int polling_freq); | ||
137 | void thermal_zone_device_unregister(struct thermal_zone_device *); | 165 | void thermal_zone_device_unregister(struct thermal_zone_device *); |
138 | 166 | ||
139 | int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, | 167 | int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, |
@@ -142,9 +170,8 @@ int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int, | |||
142 | struct thermal_cooling_device *); | 170 | struct thermal_cooling_device *); |
143 | void thermal_zone_device_update(struct thermal_zone_device *); | 171 | void thermal_zone_device_update(struct thermal_zone_device *); |
144 | struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, | 172 | struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, |
145 | struct | 173 | const struct thermal_cooling_device_ops *); |
146 | thermal_cooling_device_ops | ||
147 | *); | ||
148 | void thermal_cooling_device_unregister(struct thermal_cooling_device *); | 174 | void thermal_cooling_device_unregister(struct thermal_cooling_device *); |
175 | extern int generate_netlink_event(u32 orig, enum events event); | ||
149 | 176 | ||
150 | #endif /* __THERMAL_H__ */ | 177 | #endif /* __THERMAL_H__ */ |