]> err.no Git - linux-2.6/blobdiff - include/linux/thermal.h
Merge branch 'upstream-jeff' of git://git.kernel.org/pub/scm/linux/kernel/git/romieu...
[linux-2.6] / include / linux / thermal.h
index e4b76c7afb5171093c32f5359f9fc3a8bf1e410d..90c1c191ea694707679e067209c24b6616721f54 100644 (file)
@@ -50,7 +50,7 @@ struct thermal_cooling_device_ops {
 };
 
 #define THERMAL_TRIPS_NONE -1
-#define THERMAL_MAX_TRIPS 10
+#define THERMAL_MAX_TRIPS 12
 #define THERMAL_NAME_LENGTH 20
 struct thermal_cooling_device {
        int id;
@@ -61,6 +61,10 @@ struct thermal_cooling_device {
        struct list_head node;
 };
 
+#define KELVIN_TO_CELSIUS(t)   (long)(((long)t-2732 >= 0) ?    \
+                               ((long)t-2732+5)/10 : ((long)t-2732-5)/10)
+#define CELSIUS_TO_KELVIN(t)   ((t)*10+2732)
+
 struct thermal_zone_device {
        int id;
        char type[THERMAL_NAME_LENGTH];
@@ -75,7 +79,9 @@ struct thermal_zone_device {
 };
 
 struct thermal_zone_device *thermal_zone_device_register(char *, int, void *,
-                                       struct thermal_zone_device_ops *);
+                                                        struct
+                                                        thermal_zone_device_ops
+                                                        *);
 void thermal_zone_device_unregister(struct thermal_zone_device *);
 
 int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int,
@@ -83,8 +89,23 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int,
 int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int,
                                       struct thermal_cooling_device *);
 
+#ifdef CONFIG_THERMAL
 struct thermal_cooling_device *thermal_cooling_device_register(char *, void *,
-                                       struct thermal_cooling_device_ops *);
+                                                              struct
+                                                              thermal_cooling_device_ops
+                                                              *);
 void thermal_cooling_device_unregister(struct thermal_cooling_device *);
+#else
+static inline struct thermal_cooling_device
+*thermal_cooling_device_register(char *c, void *v,
+                                struct thermal_cooling_device_ops *t)
+{
+       return NULL;
+}
+static inline
+    void thermal_cooling_device_unregister(struct thermal_cooling_device *t)
+{
+};
+#endif
 
-#endif                         /* __THERMAL_H__ */
+#endif /* __THERMAL_H__ */