aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2008-04-21 20:50:09 -0400
committerLen Brown <len.brown@intel.com>2008-04-29 02:49:47 -0400
commite9ae71078b2c8657c0e8de808b76b76049806906 (patch)
tree32ef403038aa5e4c604b1025845cdece3b4e2689
parente68b16abd91dca91e35ea47537ef8a1b7ad72841 (diff)
thermal: update the documentation
Update the documentation for the thermal driver hwmon sys I/F. Change the ACPI thermal zone type to be consistent with hwmon. 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>
-rw-r--r--Documentation/thermal/sysfs-api.txt33
-rw-r--r--drivers/acpi/thermal.c2
2 files changed, 28 insertions, 7 deletions
diff --git a/Documentation/thermal/sysfs-api.txt b/Documentation/thermal/sysfs-api.txt
index d9f28be7540..70d68ce8640 100644
--- a/Documentation/thermal/sysfs-api.txt
+++ b/Documentation/thermal/sysfs-api.txt
@@ -108,10 +108,12 @@ and throttle appropriate devices.
108RO read only value 108RO read only value
109RW read/write value 109RW read/write value
110 110
111All thermal sysfs attributes will be represented under /sys/class/thermal 111Thermal sysfs attributes will be represented under /sys/class/thermal.
112Hwmon sysfs I/F extension is also available under /sys/class/hwmon
113if hwmon is compiled in or built as a module.
112 114
113Thermal zone device sys I/F, created once it's registered: 115Thermal zone device sys I/F, created once it's registered:
114|thermal_zone[0-*]: 116/sys/class/thermal/thermal_zone[0-*]:
115 |-----type: Type of the thermal zone 117 |-----type: Type of the thermal zone
116 |-----temp: Current temperature 118 |-----temp: Current temperature
117 |-----mode: Working mode of the thermal zone 119 |-----mode: Working mode of the thermal zone
@@ -119,7 +121,7 @@ Thermal zone device sys I/F, created once it's registered:
119 |-----trip_point_[0-*]_type: Trip point type 121 |-----trip_point_[0-*]_type: Trip point type
120 122
121Thermal cooling device sys I/F, created once it's registered: 123Thermal cooling device sys I/F, created once it's registered:
122|cooling_device[0-*]: 124/sys/class/thermal/cooling_device[0-*]:
123 |-----type : Type of the cooling device(processor/fan/...) 125 |-----type : Type of the cooling device(processor/fan/...)
124 |-----max_state: Maximum cooling state of the cooling device 126 |-----max_state: Maximum cooling state of the cooling device
125 |-----cur_state: Current cooling state of the cooling device 127 |-----cur_state: Current cooling state of the cooling device
@@ -130,10 +132,19 @@ They represent the relationship between a thermal zone and its associated coolin
130They are created/removed for each 132They are created/removed for each
131thermal_zone_bind_cooling_device/thermal_zone_unbind_cooling_device successful execution. 133thermal_zone_bind_cooling_device/thermal_zone_unbind_cooling_device successful execution.
132 134
133|thermal_zone[0-*] 135/sys/class/thermal/thermal_zone[0-*]
134 |-----cdev[0-*]: The [0-*]th cooling device in the current thermal zone 136 |-----cdev[0-*]: The [0-*]th cooling device in the current thermal zone
135 |-----cdev[0-*]_trip_point: Trip point that cdev[0-*] is associated with 137 |-----cdev[0-*]_trip_point: Trip point that cdev[0-*] is associated with
136 138
139Besides the thermal zone device sysfs I/F and cooling device sysfs I/F,
140the generic thermal driver also creates a hwmon sysfs I/F for each _type_ of
141thermal zone device. E.g. the generic thermal driver registers one hwmon class device
142and build the associated hwmon sysfs I/F for all the registered ACPI thermal zones.
143/sys/class/hwmon/hwmon[0-*]:
144 |-----name: The type of the thermal zone devices.
145 |-----temp[1-*]_input: The current temperature of thermal zone [1-*].
146 |-----temp[1-*]_critical: The critical trip point of thermal zone [1-*].
147Please read Documentation/hwmon/sysfs-interface for additional information.
137 148
138*************************** 149***************************
139* Thermal zone attributes * 150* Thermal zone attributes *
@@ -141,7 +152,10 @@ thermal_zone_bind_cooling_device/thermal_zone_unbind_cooling_device successful e
141 152
142type Strings which represent the thermal zone type. 153type Strings which represent the thermal zone type.
143 This is given by thermal zone driver as part of registration. 154 This is given by thermal zone driver as part of registration.
144 Eg: "ACPI thermal zone" indicates it's a ACPI thermal device 155 Eg: "acpitz" indicates it's an ACPI thermal device.
156 In order to keep it consistent with hwmon sys attribute,
157 this should be a short, lowercase string,
158 not containing spaces nor dashes.
145 RO 159 RO
146 Required 160 Required
147 161
@@ -218,7 +232,7 @@ the sys I/F structure will be built like this:
218/sys/class/thermal: 232/sys/class/thermal:
219 233
220|thermal_zone1: 234|thermal_zone1:
221 |-----type: ACPI thermal zone 235 |-----type: acpitz
222 |-----temp: 37000 236 |-----temp: 37000
223 |-----mode: kernel 237 |-----mode: kernel
224 |-----trip_point_0_temp: 100000 238 |-----trip_point_0_temp: 100000
@@ -243,3 +257,10 @@ the sys I/F structure will be built like this:
243 |-----type: Fan 257 |-----type: Fan
244 |-----max_state: 2 258 |-----max_state: 2
245 |-----cur_state: 0 259 |-----cur_state: 0
260
261/sys/class/hwmon:
262
263|hwmon0:
264 |-----name: acpitz
265 |-----temp1_input: 37000
266 |-----temp1_crit: 100000
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index ec707ed1a70..5e9641c93fc 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -1136,7 +1136,7 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
1136 1136
1137 for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE && 1137 for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE &&
1138 tz->trips.active[i].flags.valid; i++, trips++); 1138 tz->trips.active[i].flags.valid; i++, trips++);
1139 tz->thermal_zone = thermal_zone_device_register("ACPI thermal zone", 1139 tz->thermal_zone = thermal_zone_device_register("acpitz",
1140 trips, tz, &acpi_thermal_zone_ops); 1140 trips, tz, &acpi_thermal_zone_ops);
1141 if (IS_ERR(tz->thermal_zone)) 1141 if (IS_ERR(tz->thermal_zone))
1142 return -ENODEV; 1142 return -ENODEV;