| 1 |
Naming and data format standards under /proc |
|---|
| 2 |
-------------------------------------------- |
|---|
| 3 |
|
|---|
| 4 |
The libsensors library offers an interface to the raw sensors data |
|---|
| 5 |
through the sysctl interface. See the doc/developers/sysctl |
|---|
| 6 |
and the libsensors source for further information. |
|---|
| 7 |
|
|---|
| 8 |
An alternative method that some programs use is to access the /proc |
|---|
| 9 |
files directly. This document briefly describes the standards that |
|---|
| 10 |
the drivers follow, so that an application program can scan for |
|---|
| 11 |
entries and access this data in a simple and consistent way. |
|---|
| 12 |
|
|---|
| 13 |
Note that not all chip drivers adhere to this standard. |
|---|
| 14 |
We will attempt to migrate older drivers to this standard, |
|---|
| 15 |
and ensure that new drivers follow this standard wherever possible. |
|---|
| 16 |
If you are developing a userspace application please send us |
|---|
| 17 |
feedback on this standard. |
|---|
| 18 |
|
|---|
| 19 |
Note that motherboards vary widely in the connections to sensor chips. |
|---|
| 20 |
There is no standard that ensures, for example, that the second |
|---|
| 21 |
temperature sensor is connected to the CPU, or that the second |
|---|
| 22 |
fan is on the CPU. Therefore, programs must provide a facility |
|---|
| 23 |
for the user to label or bind /proc entries for display. |
|---|
| 24 |
Sensor chips often have unused inputs that should be ignored |
|---|
| 25 |
by user programs. |
|---|
| 26 |
|
|---|
| 27 |
Each chip gets its own directory under /proc/sys/dev/sensors. |
|---|
| 28 |
The format is either chip-i2c-bus-hexaddress or chip-isa-hexaddress. |
|---|
| 29 |
(Exception - chip lm78-j has a '-' in it - should this be changed??) |
|---|
| 30 |
New dummy drivers may present chips as chip-busname-hexaddress. |
|---|
| 31 |
|
|---|
| 32 |
All /proc values are integers or floating point numbers. |
|---|
| 33 |
There is no facility in the lm_sensors package for drivers |
|---|
| 34 |
to output general strings via /proc. This facility may be added |
|---|
| 35 |
in the future. |
|---|
| 36 |
|
|---|
| 37 |
Alarms are direct indications read from the chips. The drivers do NOT make |
|---|
| 38 |
comparisons of readings to thresholds. This allows violations |
|---|
| 39 |
between readings to be caught and alarmed. The exact definition of |
|---|
| 40 |
an alarm (for example, whether a threshold must be met or must be |
|---|
| 41 |
exceeded to cause an alarm) is chip-dependent. |
|---|
| 42 |
|
|---|
| 43 |
Guidelines for new entries: |
|---|
| 44 |
- If there are multiple values, some r/w and some r/o, |
|---|
| 45 |
put the r/w ones first. |
|---|
| 46 |
- Additional non-standard values should be after the standard values. |
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
------------------------------------------------------------------------- |
|---|
| 51 |
|
|---|
| 52 |
/proc entries are as follows: |
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 |
Entry Values Function |
|---|
| 56 |
----- ------ -------- |
|---|
| 57 |
alarms 1 Alarm bitmask. |
|---|
| 58 |
Read only. |
|---|
| 59 |
Integer representation of one to four bytes. |
|---|
| 60 |
A '1' bit means an alarm. |
|---|
| 61 |
Chips should be programmed for 'comparator' mode so that |
|---|
| 62 |
the alarm will 'come back' after you read the register |
|---|
| 63 |
if it is still valid. |
|---|
| 64 |
Generally a direct representation of a chip's internal |
|---|
| 65 |
alarm registers; there is no standard for the position |
|---|
| 66 |
of individual bits. |
|---|
| 67 |
Bits are defined in kernel/include/sensors.h. |
|---|
| 68 |
|
|---|
| 69 |
beep 2 Beep/interrupt enable and bitmask. |
|---|
| 70 |
The first value is 0 or 1 to globally disable |
|---|
| 71 |
or enable the beeps. |
|---|
| 72 |
The second value is a bitmask, with the |
|---|
| 73 |
same format as 'alarms' with same bit locations. |
|---|
| 74 |
|
|---|
| 75 |
curr[1-n] 3 Current max, min or hysteresis, and input value. |
|---|
| 76 |
Floating point values XX.X or XX.XX in Amps. |
|---|
| 77 |
The second value is preferably a hysteresis value, |
|---|
| 78 |
reported as a absolute current, NOT a delta from |
|---|
| 79 |
the max value. |
|---|
| 80 |
First two values are read/write and third is read only. |
|---|
| 81 |
|
|---|
| 82 |
fan[1-3] 2 Fan minimum and input value. |
|---|
| 83 |
Two integers indicating RPM. |
|---|
| 84 |
First value is read/write and second is read only. |
|---|
| 85 |
|
|---|
| 86 |
fan_div 3 Fan divisor. |
|---|
| 87 |
Integers in powers of two (1,2,4,8,16,32,64,128). |
|---|
| 88 |
Some chips only support values 1,2,4,8. |
|---|
| 89 |
Entries correspond to the fans[1-3]. |
|---|
| 90 |
See doc/fan-divisors for details. |
|---|
| 91 |
|
|---|
| 92 |
in[0-8] 3 Voltage min, max, and input value. |
|---|
| 93 |
Floating point values X.XX in volts from 0 to 4.01 volts. |
|---|
| 94 |
Actual voltage depends on the scaling resistors on the |
|---|
| 95 |
motherboard, as recommended in the chip datasheet. |
|---|
| 96 |
This varies by chip and by motherboard. |
|---|
| 97 |
Because of this variation, values are generally NOT scaled |
|---|
| 98 |
by the chip driver, and must be done by the application. |
|---|
| 99 |
However, some drivers (notably lm87 and via686a) |
|---|
| 100 |
do scale, with various degrees of success. |
|---|
| 101 |
These drivers will output the actual voltage. |
|---|
| 102 |
First two values are read/write and third is read only. |
|---|
| 103 |
Typical usage: |
|---|
| 104 |
in0 CPU #1 voltage (not scaled) |
|---|
| 105 |
in1 CPU #1 voltage (not scaled) |
|---|
| 106 |
in2 3.3V nominal (not scaled) |
|---|
| 107 |
in3 5.0V nominal (scaled) |
|---|
| 108 |
in4 12.0V nominal (scaled) |
|---|
| 109 |
in5 -12.0V nominal (scaled) |
|---|
| 110 |
in6 -5.0V nominal (scaled) |
|---|
| 111 |
in7 varies |
|---|
| 112 |
in8 varies |
|---|
| 113 |
|
|---|
| 114 |
pwm[1-3] 1-2 Pulse width modulation fan control. |
|---|
| 115 |
Integer 0 - 255, read/write. |
|---|
| 116 |
255 is max or 100%. |
|---|
| 117 |
Corresponds to the fans 1-3. |
|---|
| 118 |
Second value, if present, is an enable (0 or 1) |
|---|
| 119 |
|
|---|
| 120 |
sensor[1-3] 1 Sensor type selection. |
|---|
| 121 |
Integers 1,2,3, or thermistor Beta value (3435); read/write. |
|---|
| 122 |
|
|---|
| 123 |
temp, |
|---|
| 124 |
temp[1-4] 3 Temperature max, min or hysteresis, and input value. |
|---|
| 125 |
Floating point values XXX.X or XXX.XX in degrees Celsius. |
|---|
| 126 |
'temp' is used if there is only one temperature sensor on the |
|---|
| 127 |
chip; for multiple temps. start with 'temp1'. |
|---|
| 128 |
Temp1 is generally the sensor inside the chip itself, |
|---|
| 129 |
generally reported as "motherboard temperature". |
|---|
| 130 |
Temp2 to temp4 are generally sensors external to the chip |
|---|
| 131 |
itself, for example the thermal diode inside the CPU or a |
|---|
| 132 |
termistor nearby. The second value is preferably a hysteresis |
|---|
| 133 |
value, reported as a absolute temperature, NOT a delta from |
|---|
| 134 |
the max value. |
|---|
| 135 |
First two values are read/write and third is read only. |
|---|
| 136 |
|
|---|
| 137 |
vid 1 CPU core voltage. |
|---|
| 138 |
Read only. |
|---|
| 139 |
Floating point X.XX or X.XXX corresponding to CPU core voltage |
|---|
| 140 |
as told to the sensor chip. Not always correct. |
|---|
| 141 |
|
|---|
| 142 |
vrm 1 Voltage Regulator Module version number. |
|---|
| 143 |
"Floating point" X.X. Default 8.2. |
|---|
| 144 |
Affects the way the driver calculates the core voltage from |
|---|
| 145 |
the vid pins. See doc/vid for details. |
|---|