From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org, sensors@Stimpy.netroedge.com
Subject: Re: lm sensors sysfs file structure
Date: Thu, 27 Mar 2003 11:42:48 -0800 [thread overview]
Message-ID: <20030327194248.GK32667@kroah.com> (raw)
In-Reply-To: <20030326225234.GA27436@kroah.com>
[-- Attachment #1: Type: text/plain, Size: 160 bytes --]
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
[-- Attachment #2: sensors-sysfs --]
[-- Type: text/plain, Size: 5796 bytes --]
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.
next prev parent reply other threads:[~2003-03-27 19:32 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-25 8:53 i2c driver changes for 2.5.66; adding w83781d support Martin Schlemmer
2003-03-25 17:56 ` Greg KH
2003-03-26 19:04 ` w83781d i2c driver updated for 2.5.66 (without sysfs support) Martin Schlemmer
2003-03-26 19:40 ` Jan Dittmer
2003-03-26 19:54 ` Martin Schlemmer
2003-03-26 20:26 ` Greg KH
2003-03-26 20:43 ` Christoph Hellwig
2003-03-26 21:23 ` Greg KH
2003-03-26 22:26 ` Mark Studebaker
2003-03-26 22:52 ` lm sensors sysfs file structure Greg KH
2003-03-27 10:46 ` Jan Dittmer
2003-03-27 10:50 ` Martin Schlemmer
2003-03-27 12:27 ` Jan Dittmer
2003-03-27 12:33 ` Martin Schlemmer
2003-03-27 13:05 ` Jan Dittmer
2003-03-27 13:31 ` Jean Delvare
2003-03-27 17:16 ` Mark M. Hoffman
2003-03-27 17:25 ` Greg KH
2003-03-27 18:06 ` Jan Dittmer
2003-03-27 18:13 ` Greg KH
2003-03-30 19:23 ` Pavel Machek
2003-04-01 6:44 ` Greg KH
2003-04-01 20:22 ` Pavel Machek
2003-04-01 23:27 ` Dave Jones
2003-04-03 0:28 ` Greg KH
2003-04-03 10:49 ` Dave Jones
2003-04-03 18:43 ` Dominik Brodowski
2003-03-27 18:40 ` Jan Dittmer
2003-03-27 18:52 ` Greg KH
2003-03-27 18:17 ` Patrick Mochel
2003-03-27 18:57 ` Jan Dittmer
2003-03-27 19:15 ` Martin Schlemmer
2003-03-27 19:25 ` Greg KH
2003-03-27 19:42 ` Greg KH [this message]
2003-03-27 20:32 ` Jan Dittmer
2003-03-27 21:53 ` Greg KH
2003-03-27 22:23 ` Mark M. Hoffman
2003-03-28 6:05 ` Martin Schlemmer
2003-03-28 18:34 ` Pavel Machek
2003-03-26 20:29 ` w83781d i2c driver updated for 2.5.66 (without sysfs support) Greg KH
2003-03-26 23:34 ` Martin Schlemmer
2003-03-26 23:46 ` Greg KH
2003-03-30 12:47 ` [PATCH-2.5] w83781d i2c driver updated for 2.5.66-bk4 (with sysfs support, empty tree) Martin Schlemmer
2003-04-02 22:22 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2003-03-27 23:00 lm sensors sysfs file structure Albert Cahalan
2003-03-27 23:10 ` Greg KH
2003-03-28 7:21 ` Martin Schlemmer
2003-03-28 7:40 ` Greg KH
2003-04-03 21:19 Grover, Andrew
2003-04-14 15:16 ` Patrick Mochel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030327194248.GK32667@kroah.com \
--to=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sensors@Stimpy.netroedge.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox