hwmon: (tmp421) Add documentation
[safe/jmp/linux-2.6] / Documentation / hwmon / sysfs-interface
index a17b692..dcbd502 100644 (file)
@@ -2,17 +2,12 @@ Naming and data format standards for sysfs files
 ------------------------------------------------
 
 The libsensors library offers an interface to the raw sensors data
-through the sysfs interface. See libsensors documentation and source for
-further information. As of writing this document, libsensors
-(from lm_sensors 2.8.3) is heavily chip-dependent. Adding or updating
-support for any given chip requires modifying the library's code.
-This is because libsensors was written for the procfs interface
-older kernel modules were using, which wasn't standardized enough.
-Recent versions of libsensors (from lm_sensors 2.8.2 and later) have
-support for the sysfs interface, though.
-
-The new sysfs interface was designed to be as chip-independent as
-possible.
+through the sysfs interface. Since lm-sensors 3.0.0, libsensors is
+completely chip-independent. It assumes that all the kernel drivers
+implement the standard sysfs interface described in this document.
+This makes adding or updating support for any given chip very easy, as
+libsensors, and applications using it, do not need to be modified.
+This is a major improvement compared to lm-sensors 2.
 
 Note that motherboards vary widely in the connections to sensor chips.
 There is no standard that ensures, for example, that the second
@@ -35,19 +30,17 @@ access this data in a simple and consistent way. That said, such programs
 will have to implement conversion, labeling and hiding of inputs. For
 this reason, it is still not recommended to bypass the library.
 
-If you are developing a userspace application please send us feedback on
-this standard.
-
-Note that this standard isn't completely established yet, so it is subject
-to changes. If you are writing a new hardware monitoring driver those
-features can't seem to fit in this interface, please contact us with your
-extension proposal. Keep in mind that backward compatibility must be
-preserved.
-
 Each chip gets its own directory in the sysfs /sys/devices tree.  To
 find all sensor chips, it is easier to follow the device symlinks from
 /sys/class/hwmon/hwmon*.
 
+Up to lm-sensors 3.0.0, libsensors looks for hardware monitoring attributes
+in the "physical" device directory. Since lm-sensors 3.0.1, attributes found
+in the hwmon "class" device directory are also supported. Complex drivers
+(e.g. drivers for multifunction chips) may want to use this possibility to
+avoid namespace pollution. The only drawback will be that older versions of
+libsensors won't support the driver in question.
+
 All sysfs values are fixed point numbers.
 
 There is only one value per file, unlike the older /proc specification.
@@ -77,6 +70,7 @@ are interpreted as 0! For more on how written strings are interpreted see the
 [0-*]  denotes any positive number starting from 0
 [1-*]  denotes any positive number starting from 1
 RO     read only value
+WO     write only value
 RW     read/write value
 
 Read/write values may be read-only for some chips, depending on the
@@ -157,6 +151,11 @@ fan[1-*]_min       Fan minimum value
                Unit: revolution/min (RPM)
                RW
 
+fan[1-*]_max   Fan maximum value
+               Unit: revolution/min (RPM)
+               Only rarely supported by the hardware.
+               RW
+
 fan[1-*]_input Fan input value.
                Unit: revolution/min (RPM)
                RO
@@ -297,6 +296,24 @@ temp[1-*]_label    Suggested temperature channel label.
                user-space.
                RO
 
+temp[1-*]_lowest
+               Historical minimum temperature
+               Unit: millidegree Celsius
+               RO
+
+temp[1-*]_highest
+               Historical maximum temperature
+               Unit: millidegree Celsius
+               RO
+
+temp[1-*]_reset_history
+               Reset temp_lowest and temp_highest
+               WO
+
+temp_reset_history
+               Reset temp_lowest and temp_highest for all sensors
+               WO
+
 Some chips measure temperature using external thermistors and an ADC, and
 report the temperature measurement as a voltage. Converting this voltage
 back to a temperature (or the other way around for limits) requires
@@ -328,6 +345,50 @@ curr[1-*]_input    Current input value
                Unit: milliampere
                RO
 
+*********
+* Power *
+*********
+
+power[1-*]_average             Average power use
+                               Unit: microWatt
+                               RO
+
+power[1-*]_average_interval    Power use averaging interval
+                               Unit: milliseconds
+                               RW
+
+power[1-*]_average_highest     Historical average maximum power use
+                               Unit: microWatt
+                               RO
+
+power[1-*]_average_lowest      Historical average minimum power use
+                               Unit: microWatt
+                               RO
+
+power[1-*]_input               Instantaneous power use
+                               Unit: microWatt
+                               RO
+
+power[1-*]_input_highest       Historical maximum power use
+                               Unit: microWatt
+                               RO
+
+power[1-*]_input_lowest                Historical minimum power use
+                               Unit: microWatt
+                               RO
+
+power[1-*]_reset_history       Reset input_highest, input_lowest,
+                               average_highest and average_lowest.
+                               WO
+
+**********
+* Energy *
+**********
+
+energy[1-*]_input              Cumulative energy use
+                               Unit: microJoule
+                               RO
+
 
 **********
 * Alarms *
@@ -353,6 +414,7 @@ OR
 in[0-*]_min_alarm
 in[0-*]_max_alarm
 fan[1-*]_min_alarm
+fan[1-*]_max_alarm
 temp[1-*]_min_alarm
 temp[1-*]_max_alarm
 temp[1-*]_crit_alarm
@@ -417,6 +479,27 @@ beep_mask  Bitmask for beep.
                RW
 
 
+***********************
+* Intrusion detection *
+***********************
+
+intrusion[0-*]_alarm
+               Chassis intrusion detection
+               0: OK
+               1: intrusion detected
+               RW
+               Contrary to regular alarm flags which clear themselves
+               automatically when read, this one sticks until cleared by
+               the user. This is done by writing 0 to the file. Writing
+               other values is unsupported.
+
+intrusion[0-*]_beep
+               Chassis intrusion beep
+               0: disable
+               1: enable
+               RW
+
+
 sysfs attribute writes interpretation
 -------------------------------------