aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/thermal.h
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2008-04-21 04:07:52 -0400
committerLen Brown <len.brown@intel.com>2008-04-29 02:48:01 -0400
commite68b16abd91dca91e35ea47537ef8a1b7ad72841 (patch)
tree24f368ec94bc55447324131d4890fdcd4a3d082d /include/linux/thermal.h
parent9ec732ff80b7e8a9096666f78ae584d3b393bc84 (diff)
thermal: add hwmon sysfs I/F
Add hwmon sys I/F for generic thermal driver. Note: we have one hwmon class device for EACH TYPE of the thermal zone device. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include/linux/thermal.h')
-rw-r--r--include/linux/thermal.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 16e6a8bdeb3c..06d3e6eb9ca8 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -66,6 +66,23 @@ struct thermal_cooling_device {
66 ((long)t-2732+5)/10 : ((long)t-2732-5)/10) 66 ((long)t-2732+5)/10 : ((long)t-2732-5)/10)
67#define CELSIUS_TO_KELVIN(t) ((t)*10+2732) 67#define CELSIUS_TO_KELVIN(t) ((t)*10+2732)
68 68
69#if defined(CONFIG_HWMON) || \
70 (defined(CONFIG_HWMON_MODULE) && defined(CONFIG_THERMAL_MODULE))
71/* thermal zone devices with the same type share one hwmon device */
72struct thermal_hwmon_device {
73 char type[THERMAL_NAME_LENGTH];
74 struct device *device;
75 int count;
76 struct list_head tz_list;
77 struct list_head node;
78};
79
80struct thermal_hwmon_attr {
81 struct device_attribute attr;
82 char name[16];
83};
84#endif
85
69struct thermal_zone_device { 86struct thermal_zone_device {
70 int id; 87 int id;
71 char type[THERMAL_NAME_LENGTH]; 88 char type[THERMAL_NAME_LENGTH];
@@ -77,6 +94,13 @@ struct thermal_zone_device {
77 struct idr idr; 94 struct idr idr;
78 struct mutex lock; /* protect cooling devices list */ 95 struct mutex lock; /* protect cooling devices list */
79 struct list_head node; 96 struct list_head node;
97#if defined(CONFIG_HWMON) || \
98 (defined(CONFIG_HWMON_MODULE) && defined(CONFIG_THERMAL_MODULE))
99 struct list_head hwmon_node;
100 struct thermal_hwmon_device *hwmon;
101 struct thermal_hwmon_attr temp_input; /* hwmon sys attr */
102 struct thermal_hwmon_attr temp_crit; /* hwmon sys attr */
103#endif
80}; 104};
81 105
82struct thermal_zone_device *thermal_zone_device_register(char *, int, void *, 106struct thermal_zone_device *thermal_zone_device_register(char *, int, void *,