| 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 access |
|---|
| 11 | 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 | As 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 | |
|---|
| 31 | All /proc values are integers or floating point numbers. |
|---|
| 32 | There is no facility in the lm_sensors package for drivers |
|---|
| 33 | to output general strings via /proc. |
|---|
| 34 | |
|---|
| 35 | Guidelines for new entries: |
|---|
| 36 | - If there are multiple values, some r/w and some r/o, |
|---|
| 37 | put the r/w ones first |
|---|
| 38 | |
|---|
| 39 | |
|---|
| 40 | ------------------------------------------------------------------------- |
|---|
| 41 | |
|---|
| 42 | /proc entries are as follows: |
|---|
| 43 | |
|---|
| 44 | |
|---|
| 45 | Entry Values Function |
|---|
| 46 | ----- ------ -------- |
|---|
| 47 | alarms 1 Alarm bitmask. |
|---|
| 48 | Read only. |
|---|
| 49 | Integer representation of one, two, or three bytes. |
|---|
| 50 | A '1' bit means an alarm. |
|---|
| 51 | Chips should be programmed for 'comparator' mode so that |
|---|
| 52 | the alarm will 'come back' after you read the register |
|---|
| 53 | if it is still valid. |
|---|
| 54 | Generally a direct representation of a chip's internal |
|---|
| 55 | alarm registers; there is no standard for the position |
|---|
| 56 | of individual bits. |
|---|
| 57 | Bits are defined in kernel/include/sensors.h. |
|---|
| 58 | |
|---|
| 59 | beep 2 Beep/interrupt enable and bitmask. |
|---|
| 60 | The first value is 0 or 1 to globally disable |
|---|
| 61 | or enable the beeps. |
|---|
| 62 | The second value is a bitmask, with the |
|---|
| 63 | same format as 'alarms' with same bit locations. |
|---|
| 64 | |
|---|
| 65 | fan[1-3] 2 Fan minimum and input value. |
|---|
| 66 | Two integers indicating RPM. |
|---|
| 67 | First value is read/write and second is read only. |
|---|
| 68 | |
|---|
| 69 | fan_div 3 Fan divisor. |
|---|
| 70 | Integers in powers of two (1,2,4,8,16,32,64,128). |
|---|
| 71 | Some chips only support values 1,2,4,8. |
|---|
| 72 | Entries correspond to the fans[1-3]. |
|---|
| 73 | See doc/fan-divisors for details. |
|---|
| 74 | |
|---|
| 75 | in[0-8] 3 Voltage min, max, and input value. |
|---|
| 76 | Floating point values X.XX in volts from 0 to 4.01 volts. |
|---|
| 77 | Actual voltage depends on the scaling resistors on the |
|---|
| 78 | motherboard, as recommended in the chip datasheet. |
|---|
| 79 | This varies by chip and by motherboard. |
|---|
| 80 | Because of this variation, values are generally NOT scaled |
|---|
| 81 | by the chip driver, and must be done by the application. |
|---|
| 82 | However, some drivers (notably lm87 and via686a) |
|---|
| 83 | do scale, with various degrees of success. |
|---|
| 84 | These drivers will output the actual voltage. |
|---|
| 85 | First two values are read/write and third is read only. |
|---|
| 86 | Typical usage: |
|---|
| 87 | in0 CPU #1 voltage (not scaled) |
|---|
| 88 | in1 CPU #1 voltage (not scaled) |
|---|
| 89 | in2 3.3V nominal (not scaled) |
|---|
| 90 | in3 5.0V nominal (scaled) |
|---|
| 91 | in4 12.0V nominal (scaled) |
|---|
| 92 | in5 -12.0V nominal (scaled) |
|---|
| 93 | in6 -5.0V nominal (scaled) |
|---|
| 94 | in7 varies |
|---|
| 95 | in8 varies |
|---|
| 96 | |
|---|
| 97 | pwm[1-3] 1- 2 Pulse width modulation fan control. |
|---|
| 98 | Integer 0 - 255, read/write. |
|---|
| 99 | Corresponds to the fans 1-3. |
|---|
| 100 | Second value, if present, is an enable (0 or 1) |
|---|
| 101 | |
|---|
| 102 | sensor[1-3] 1 Sensor type selection. |
|---|
| 103 | Integers 1,2,3, or thermistor Beta value (3435); read/write. |
|---|
| 104 | |
|---|
| 105 | temp, |
|---|
| 106 | temp[1-3] 3 Temperature max, min or hysteresis, and input value. |
|---|
| 107 | Floating point values XXX.X or XXX.XX in degrees Celcius. |
|---|
| 108 | 'temp' is used if there is only one temperature sensor on the |
|---|
| 109 | chip. Temp1 is generally the sensor inside the chip itself, |
|---|
| 110 | generally reported as "motherboard temperature". |
|---|
| 111 | Temp2 and temp3 are generally external sensors, |
|---|
| 112 | the thermal diode inside the CPU, generally reported as |
|---|
| 113 | "CPU temperature". |
|---|
| 114 | |
|---|
| 115 | vid 1 CPU core voltage. |
|---|
| 116 | Read only. |
|---|
| 117 | Floating point X.XX or X.XXX corresponding to CPU core voltage |
|---|
| 118 | as told to the sensor chip. Not always correct. |
|---|
| 119 | |
|---|
| 120 | vrm 1 Voltage Regulator Module version number. |
|---|
| 121 | "Floating point" X.X. Default 8.2. |
|---|
| 122 | Affects the way the driver calculates the core voltage from |
|---|
| 123 | the vid pins. See doc/vid for details. |
|---|