Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 27 Mar 2003 14:32:47 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 27 Mar 2003 14:32:46 -0500 Received: from 12-231-249-244.client.attbi.com ([12.231.249.244]:51720 "HELO kroah.com") by vger.kernel.org with SMTP id ; Thu, 27 Mar 2003 14:32:37 -0500 Date: Thu, 27 Mar 2003 11:42:48 -0800 From: Greg KH To: linux-kernel@vger.kernel.org, sensors@Stimpy.netroedge.com Subject: Re: lm sensors sysfs file structure Message-ID: <20030327194248.GK32667@kroah.com> References: <1048582394.4774.7.camel@workshop.saharact.lan> <20030325175603.GG15823@kroah.com> <1048705473.7569.10.camel@nosferatu.lan> <3E82024A.4000809@portrix.net> <20030326202622.GJ24689@kroah.com> <3E82292E.536D9196@paradyne.com> <20030326225234.GA27436@kroah.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="oyUTqETQ0mS9luUI" Content-Disposition: inline In-Reply-To: <20030326225234.GA27436@kroah.com> User-Agent: Mutt/1.4i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 6434 Lines: 203 --oyUTqETQ0mS9luUI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Ok, I've modified the /proc file document to reflect the proposed sysfs file changes and included it below. Any comments? Any objections? thanks, greg k-h --oyUTqETQ0mS9luUI Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=sensors-sysfs 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 more further information. An alternative method that some programs use is to access the sysfs files directly. This document briefly describes the standards that the drivers follow, so that an application program can scan for entries and access this data in a simple and consistent way. If you are developing a userspace application please send us feedback on this standard. Note that motherboards vary widely in the connections to sensor chips. There is no standard that ensures, for example, that the second temperature sensor is connected to the CPU, or that the second fan is on the CPU. Therefore, programs must provide a facility for the user to label or bind /proc entries for display. Sensor chips often have unused inputs that should be ignored by user programs. Each chip gets its own directory in the sysfs /sys/devices tree. To find all sensor chips, it is easier to follow the symlinks from /sys/i2c/devices/ All sysfs values are fixed point numbers. To get the true value of some of the values, you should divide by the specified value. There is only one value per file, unlike the older /proc specification. Alarms are direct indications read from the chips. The drivers do NOT make comparisons of readings to thresholds. This allows violations between readings to be caught and alarmed. The exact definition of an alarm (for example, whether a threshold must be met or must be exceeded to cause an alarm) is chip-dependent. ------------------------------------------------------------------------- sysfs entries are as follows: Entry Function ----- -------- alarms Alarm bitmask. Read only. Integer representation of one to four bytes. A '1' bit means an alarm. Chips should be programmed for 'comparator' mode so that the alarm will 'come back' after you read the register if it is still valid. Generally a direct representation of a chip's internal alarm registers; there is no standard for the position of individual bits. Bits are defined in kernel/include/sensors.h. beep_enable Beep/interrupt enable 0 to disable. 1 to enable. Read/Write beep_mask Bitmask for beep. Same format as 'alarms' with the same bit locations. Read only. curr_max[1-n] Current max value Fixed point XXXX, divide by 100 to get Amps. Read/Write. curr_min[1-n] Current min or hysteresis value. Preferably a hysteresis value, reported as a absolute current, NOT a delta from the max value. Fixed point XXXX, divide by 100 to get Amps. Read/Write. curr_input[1-n] Current input value Fixed point XXXX, divide by 100 to get Amps. Read only. fan_min[1-3] Fan minimum value Integer value indicating RPM Read/Write. fan_input[1-3] Fan input value. Integer value indicating RPM Read only. fan_div[1-3] Fan divisor. Integers in powers of two (1,2,4,8,16,32,64,128). Some chips only support values 1,2,4,8. See doc/fan-divisors for details. in_min[0-8] Voltage min value. Fixed point value in form XXX. Divide by 100 to get Volts. Read/Write in_max[0-8] Voltage max value. Fixed point value in form XXX. Divide by 100 to get Volts. Read/Write in_input[0-8] Voltage input value. Fixed point value in form XXX. Divide by 100 to get Volts. Read only Actual voltage depends on the scaling resistors on the motherboard, as recommended in the chip datasheet. This varies by chip and by motherboard. Because of this variation, values are generally NOT scaled by the chip driver, and must be done by the application. However, some drivers (notably lm87 and via686a) do scale, with various degrees of success. These drivers will output the actual voltage. First two values are read/write and third is read only. Typical usage: in_*0 CPU #1 voltage (not scaled) in_*1 CPU #1 voltage (not scaled) in_*2 3.3V nominal (not scaled) in_*3 5.0V nominal (scaled) in_*4 12.0V nominal (scaled) in_*5 -12.0V nominal (scaled) in_*6 -5.0V nominal (scaled) in_*7 varies in_*8 varies pwn[1-3] Pulse width modulation fan control. Integer 0 - 255 Read/Write 255 is max or 100%. Corresponds to the fans 1-3. pwn_enable[1-3] pwn enable not always present even if pwn* is. 0 to turn off 1 to turn on Read/Write sensor[1-3] Sensor type selection. Integers 1,2,3, or thermistor Beta value (3435) Read/Write. temp_max[1-3] Temperature max value. Fixed point value in form XXXXX and should be divided by 100 to get degrees Celsius. Read/Write value. temp_min[1-3] Temperature min or hysteresis value. Fixed point value in form XXXXX and should be divided by 100 to get degrees Celsius. This is preferably a hysteresis value, reported as a absolute temperature, NOT a delta from the max value. Read/Write value. temp_input[1-3] Temperature input value. Read only value. If there are multiple temperature sensors, temp_*1 is generally the sensor inside the chip itself, generally reported as "motherboard temperature". temp_*2 and temp_*3 are generally sensors external to the chip itself, for example the thermal diode inside the CPU or a thermistor nearby. vid CPU core voltage. Read only. Fixed point value in form XXXX corresponding to CPU core voltage as told to the sensor chip. Divide by 1000 to get Volts. Not always correct. vrm Voltage Regulator Module version number. Read only. Two digit number (XX), first is major version, second is minor version. Affects the way the driver calculates the core voltage from the vid pins. See doc/vid for details. --oyUTqETQ0mS9luUI-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/