aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/hwmon/sysfs-interface45
1 files changed, 29 insertions, 16 deletions
diff --git a/Documentation/hwmon/sysfs-interface b/Documentation/hwmon/sysfs-interface
index bc59a5113d17..d1d390aaf620 100644
--- a/Documentation/hwmon/sysfs-interface
+++ b/Documentation/hwmon/sysfs-interface
@@ -3,15 +3,15 @@ Naming and data format standards for sysfs files
3 3
4The libsensors library offers an interface to the raw sensors data 4The libsensors library offers an interface to the raw sensors data
5through the sysfs interface. See libsensors documentation and source for 5through the sysfs interface. See libsensors documentation and source for
6more further information. As of writing this document, libsensors 6further information. As of writing this document, libsensors
7(from lm_sensors 2.8.3) is heavily chip-dependant. Adding or updating 7(from lm_sensors 2.8.3) is heavily chip-dependent. Adding or updating
8support for any given chip requires modifying the library's code. 8support for any given chip requires modifying the library's code.
9This is because libsensors was written for the procfs interface 9This is because libsensors was written for the procfs interface
10older kernel modules were using, which wasn't standardized enough. 10older kernel modules were using, which wasn't standardized enough.
11Recent versions of libsensors (from lm_sensors 2.8.2 and later) have 11Recent versions of libsensors (from lm_sensors 2.8.2 and later) have
12support for the sysfs interface, though. 12support for the sysfs interface, though.
13 13
14The new sysfs interface was designed to be as chip-independant as 14The new sysfs interface was designed to be as chip-independent as
15possible. 15possible.
16 16
17Note that motherboards vary widely in the connections to sensor chips. 17Note that motherboards vary widely in the connections to sensor chips.
@@ -24,7 +24,7 @@ range using external resistors. Since the values of these resistors
24can change from motherboard to motherboard, the conversions cannot be 24can change from motherboard to motherboard, the conversions cannot be
25hard coded into the driver and have to be done in user space. 25hard coded into the driver and have to be done in user space.
26 26
27For this reason, even if we aim at a chip-independant libsensors, it will 27For this reason, even if we aim at a chip-independent libsensors, it will
28still require a configuration file (e.g. /etc/sensors.conf) for proper 28still require a configuration file (e.g. /etc/sensors.conf) for proper
29values conversion, labeling of inputs and hiding of unused inputs. 29values conversion, labeling of inputs and hiding of unused inputs.
30 30
@@ -39,15 +39,16 @@ If you are developing a userspace application please send us feedback on
39this standard. 39this standard.
40 40
41Note that this standard isn't completely established yet, so it is subject 41Note that this standard isn't completely established yet, so it is subject
42to changes, even important ones. One more reason to use the library instead 42to changes. If you are writing a new hardware monitoring driver those
43of accessing sysfs files directly. 43features can't seem to fit in this interface, please contact us with your
44extension proposal. Keep in mind that backward compatibility must be
45preserved.
44 46
45Each chip gets its own directory in the sysfs /sys/devices tree. To 47Each chip gets its own directory in the sysfs /sys/devices tree. To
46find all sensor chips, it is easier to follow the symlinks from 48find all sensor chips, it is easier to follow the device symlinks from
47/sys/i2c/devices/ 49/sys/class/hwmon/hwmon*.
48 50
49All sysfs values are fixed point numbers. To get the true value of some 51All sysfs values are fixed point numbers.
50of the values, you should divide by the specified value.
51 52
52There is only one value per file, unlike the older /proc specification. 53There is only one value per file, unlike the older /proc specification.
53The common scheme for files naming is: <type><number>_<item>. Usual 54The common scheme for files naming is: <type><number>_<item>. Usual
@@ -77,6 +78,9 @@ RW read/write value
77Read/write values may be read-only for some chips, depending on the 78Read/write values may be read-only for some chips, depending on the
78hardware implementation. 79hardware implementation.
79 80
81All entries are optional, and should only be created in a given driver
82if the chip has the feature.
83
80************ 84************
81* Voltages * 85* Voltages *
82************ 86************
@@ -213,32 +217,32 @@ temp[1-*]_type Sensor type selection.
213 Not all types are supported by all chips 217 Not all types are supported by all chips
214 218
215temp[1-*]_max Temperature max value. 219temp[1-*]_max Temperature max value.
216 Unit: millidegree Celcius 220 Unit: millidegree Celsius (or millivolt, see below)
217 RW 221 RW
218 222
219temp[1-*]_min Temperature min value. 223temp[1-*]_min Temperature min value.
220 Unit: millidegree Celcius 224 Unit: millidegree Celsius
221 RW 225 RW
222 226
223temp[1-*]_max_hyst 227temp[1-*]_max_hyst
224 Temperature hysteresis value for max limit. 228 Temperature hysteresis value for max limit.
225 Unit: millidegree Celcius 229 Unit: millidegree Celsius
226 Must be reported as an absolute temperature, NOT a delta 230 Must be reported as an absolute temperature, NOT a delta
227 from the max value. 231 from the max value.
228 RW 232 RW
229 233
230temp[1-*]_input Temperature input value. 234temp[1-*]_input Temperature input value.
231 Unit: millidegree Celcius 235 Unit: millidegree Celsius
232 RO 236 RO
233 237
234temp[1-*]_crit Temperature critical value, typically greater than 238temp[1-*]_crit Temperature critical value, typically greater than
235 corresponding temp_max values. 239 corresponding temp_max values.
236 Unit: millidegree Celcius 240 Unit: millidegree Celsius
237 RW 241 RW
238 242
239temp[1-*]_crit_hyst 243temp[1-*]_crit_hyst
240 Temperature hysteresis value for critical limit. 244 Temperature hysteresis value for critical limit.
241 Unit: millidegree Celcius 245 Unit: millidegree Celsius
242 Must be reported as an absolute temperature, NOT a delta 246 Must be reported as an absolute temperature, NOT a delta
243 from the critical value. 247 from the critical value.
244 RW 248 RW
@@ -256,6 +260,15 @@ temp[1-4]_offset
256 itself, for example the thermal diode inside the CPU or 260 itself, for example the thermal diode inside the CPU or
257 a thermistor nearby. 261 a thermistor nearby.
258 262
263Some chips measure temperature using external thermistors and an ADC, and
264report the temperature measurement as a voltage. Converting this voltage
265back to a temperature (or the other way around for limits) requires
266mathematical functions not available in the kernel, so the conversion
267must occur in user space. For these chips, all temp* files described
268above should contain values expressed in millivolt instead of millidegree
269Celsius. In other words, such temperature channels are handled as voltage
270channels by the driver.
271
259Also see the Alarms section for status flags associated with temperatures. 272Also see the Alarms section for status flags associated with temperatures.
260 273
261 274