Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Zhang Rui and committed by
Len Brown
e9ae7107 e68b16ab

+28 -7
+27 -6
Documentation/thermal/sysfs-api.txt
··· 108 108 RO read only value 109 109 RW read/write value 110 110 111 - All thermal sysfs attributes will be represented under /sys/class/thermal 111 + Thermal sysfs attributes will be represented under /sys/class/thermal. 112 + Hwmon sysfs I/F extension is also available under /sys/class/hwmon 113 + if hwmon is compiled in or built as a module. 112 114 113 115 Thermal zone device sys I/F, created once it's registered: 114 - |thermal_zone[0-*]: 116 + /sys/class/thermal/thermal_zone[0-*]: 115 117 |-----type: Type of the thermal zone 116 118 |-----temp: Current temperature 117 119 |-----mode: Working mode of the thermal zone ··· 121 119 |-----trip_point_[0-*]_type: Trip point type 122 120 123 121 Thermal cooling device sys I/F, created once it's registered: 124 - |cooling_device[0-*]: 122 + /sys/class/thermal/cooling_device[0-*]: 125 123 |-----type : Type of the cooling device(processor/fan/...) 126 124 |-----max_state: Maximum cooling state of the cooling device 127 125 |-----cur_state: Current cooling state of the cooling device ··· 132 130 They are created/removed for each 133 131 thermal_zone_bind_cooling_device/thermal_zone_unbind_cooling_device successful execution. 134 132 135 - |thermal_zone[0-*] 133 + /sys/class/thermal/thermal_zone[0-*] 136 134 |-----cdev[0-*]: The [0-*]th cooling device in the current thermal zone 137 135 |-----cdev[0-*]_trip_point: Trip point that cdev[0-*] is associated with 138 136 137 + Besides the thermal zone device sysfs I/F and cooling device sysfs I/F, 138 + the generic thermal driver also creates a hwmon sysfs I/F for each _type_ of 139 + thermal zone device. E.g. the generic thermal driver registers one hwmon class device 140 + and build the associated hwmon sysfs I/F for all the registered ACPI thermal zones. 141 + /sys/class/hwmon/hwmon[0-*]: 142 + |-----name: The type of the thermal zone devices. 143 + |-----temp[1-*]_input: The current temperature of thermal zone [1-*]. 144 + |-----temp[1-*]_critical: The critical trip point of thermal zone [1-*]. 145 + Please read Documentation/hwmon/sysfs-interface for additional information. 139 146 140 147 *************************** 141 148 * Thermal zone attributes * ··· 152 141 153 142 type Strings which represent the thermal zone type. 154 143 This is given by thermal zone driver as part of registration. 155 - Eg: "ACPI thermal zone" indicates it's a ACPI thermal device 144 + Eg: "acpitz" indicates it's an ACPI thermal device. 145 + In order to keep it consistent with hwmon sys attribute, 146 + this should be a short, lowercase string, 147 + not containing spaces nor dashes. 156 148 RO 157 149 Required 158 150 ··· 232 218 /sys/class/thermal: 233 219 234 220 |thermal_zone1: 235 - |-----type: ACPI thermal zone 221 + |-----type: acpitz 236 222 |-----temp: 37000 237 223 |-----mode: kernel 238 224 |-----trip_point_0_temp: 100000 ··· 257 243 |-----type: Fan 258 244 |-----max_state: 2 259 245 |-----cur_state: 0 246 + 247 + /sys/class/hwmon: 248 + 249 + |hwmon0: 250 + |-----name: acpitz 251 + |-----temp1_input: 37000 252 + |-----temp1_crit: 100000
+1 -1
drivers/acpi/thermal.c
··· 1136 1136 1137 1137 for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE && 1138 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 1140 trips, tz, &acpi_thermal_zone_ops); 1141 1141 if (IS_ERR(tz->thermal_zone)) 1142 1142 return -ENODEV;