]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - include/linux/thermal.h
Merge tag 'v2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[mv-sheeva.git] / include / linux / thermal.h
index 1de8b9eb841bad4bdfe346178055c84ea5caca07..d3ec89fb4122610c26dfe0d86f499d50539280ff 100644 (file)
@@ -77,7 +77,7 @@ struct thermal_cooling_device {
        char type[THERMAL_NAME_LENGTH];
        struct device device;
        void *devdata;
-       struct thermal_cooling_device_ops *ops;
+       const struct thermal_cooling_device_ops *ops;
        struct list_head node;
 };
 
@@ -114,7 +114,7 @@ struct thermal_zone_device {
        int last_temperature;
        bool passive;
        unsigned int forced_passive;
-       struct thermal_zone_device_ops *ops;
+       const struct thermal_zone_device_ops *ops;
        struct list_head cooling_devices;
        struct idr idr;
        struct mutex lock;      /* protect cooling devices list */
@@ -127,13 +127,41 @@ struct thermal_zone_device {
        struct thermal_hwmon_attr temp_crit;    /* hwmon sys attr */
 #endif
 };
+/* Adding event notification support elements */
+#define THERMAL_GENL_FAMILY_NAME                "thermal_event"
+#define THERMAL_GENL_VERSION                    0x01
+#define THERMAL_GENL_MCAST_GROUP_NAME           "thermal_mc_group"
+
+enum events {
+       THERMAL_AUX0,
+       THERMAL_AUX1,
+       THERMAL_CRITICAL,
+       THERMAL_DEV_FAULT,
+};
+
+struct thermal_genl_event {
+       u32 orig;
+       enum events event;
+};
+/* attributes of thermal_genl_family */
+enum {
+       THERMAL_GENL_ATTR_UNSPEC,
+       THERMAL_GENL_ATTR_EVENT,
+       __THERMAL_GENL_ATTR_MAX,
+};
+#define THERMAL_GENL_ATTR_MAX (__THERMAL_GENL_ATTR_MAX - 1)
+
+/* commands supported by the thermal_genl_family */
+enum {
+       THERMAL_GENL_CMD_UNSPEC,
+       THERMAL_GENL_CMD_EVENT,
+       __THERMAL_GENL_CMD_MAX,
+};
+#define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1)
 
 struct thermal_zone_device *thermal_zone_device_register(char *, int, void *,
-                                                        struct
-                                                        thermal_zone_device_ops
-                                                        *, int tc1, int tc2,
-                                                        int passive_freq,
-                                                        int polling_freq);
+               const struct thermal_zone_device_ops *, int tc1, int tc2,
+               int passive_freq, int polling_freq);
 void thermal_zone_device_unregister(struct thermal_zone_device *);
 
 int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int,
@@ -142,9 +170,16 @@ int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int,
                                       struct thermal_cooling_device *);
 void thermal_zone_device_update(struct thermal_zone_device *);
 struct thermal_cooling_device *thermal_cooling_device_register(char *, void *,
-                                                              struct
-                                                              thermal_cooling_device_ops
-                                                              *);
+               const struct thermal_cooling_device_ops *);
 void thermal_cooling_device_unregister(struct thermal_cooling_device *);
 
+#ifdef CONFIG_NET
+extern int generate_netlink_event(u32 orig, enum events event);
+#else
+static inline int generate_netlink_event(u32 orig, enum events event)
+{
+       return 0;
+}
+#endif
+
 #endif /* __THERMAL_H__ */