diff options
author | R.Durgadoss <durgadoss.r@intel.com> | 2010-10-26 18:03:29 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-01-12 00:08:35 -0500 |
commit | 4cb18728709683c91a5f6f8d5f337bfb498b089a (patch) | |
tree | 26edef8257934247a7b5fe74ac33d54e1a0ad71b /include/linux/thermal.h | |
parent | e8a7e48bb248a1196484d3f8afa53bded2b24e71 (diff) |
thermal: Add event notification to thermal framework
This patch adds event notification support to the generic
thermal sysfs framework in the kernel. The notification is in the
form of a netlink event.
Signed-off-by: R.Durgadoss <durgadoss.r@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include/linux/thermal.h')
-rw-r--r-- | include/linux/thermal.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 1de8b9eb841b..784644961279 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h | |||
@@ -127,6 +127,37 @@ 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 | struct |
@@ -146,5 +177,6 @@ struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, | |||
146 | thermal_cooling_device_ops | 177 | thermal_cooling_device_ops |
147 | *); | 178 | *); |
148 | void thermal_cooling_device_unregister(struct thermal_cooling_device *); | 179 | void thermal_cooling_device_unregister(struct thermal_cooling_device *); |
180 | extern int generate_netlink_event(u32 orig, enum events event); | ||
149 | 181 | ||
150 | #endif /* __THERMAL_H__ */ | 182 | #endif /* __THERMAL_H__ */ |