root/lm-sensors/branches/lm-sensors-3.0.0/lib/sensors.conf.5 @ 4677

Revision 4677, 10.4 KB (checked in by khali, 6 years ago)

Chip types can no longer contain dashes. This makes it possible to
rewrite sensors_parse_chip_name() with a simpler algorithm. The new
code is smaller by about one third, and twice as fast on average
(5 times as fast in the most frequent case "foo-*".)

This closes ticket #2221.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1.\" Copyright 1998, 1999 Adrian Baugh <adrian.baugh@keble.ox.ac.uk> and
2.\" Frodo Looijaard <frodol@dds.nl>
3.\"
4.\" Permission is granted to make and distribute verbatim copies of this
5.\" manual provided the copyright notice and this permission notice are
6.\" preserved on all copies.
7.\"
8.\" Permission is granted to copy and distribute modified versions of this
9.\" manual under the conditions for verbatim copying, provided that the
10.\" entire resulting derived work is distributed under the terms of a
11.\" permission notice identical to this one
12.\"
13.\" Since the Linux kernel and libraries are constantly changing, this
14.\" manual page may be incorrect or out-of-date.  The author(s) assume no
15.\" responsibility for errors or omissions, or for damages resulting from
16.\" the use of the information contained herein.  The author(s) may not
17.\" have taken the same level of care in the production of this manual,
18.\" which is licensed free of charge, as they might when working
19.\" professionally.
20.\"
21.\" Formatted or processed versions of this manual, if unaccompanied by
22.\" the source, must acknowledge the copyright and authors of this work.
23.\"
24.\" References consulted:
25.\"     sensors.conf.eg by Frodo Looijaard
26.TH sensors.conf 5  "June 2007" "" "Linux Programmer's Manual"
27.SH NAME
28sensors.conf \- libsensors configuration file
29
30.SH DESCRIPTION
31sensors.conf describes how libsensors, and so all programs using it, should
32translate the raw readings from the kernel modules to real\-world values.
33
34.SH SYNTAX
35Comments are introduces by hash marks. A comment continues to the end of the
36line. Empty lines, and lines containing only whitespace or comments are
37ignored.  Other lines have one of the below forms. There must be whitespace
38between each element, but the amount of whitespace is unimportant. A line
39may be continued on the next line by ending it with a backslash; this does
40not work within a comment,
41.B NAME
42or
43.BR NUMBER .
44
45.RS
46bus
47.B NAME NAME NAME
48.sp 0
49chip
50.B NAME\-LIST
51.sp 0
52label
53.B NAME NAME
54.sp 0
55compute
56.B NAME EXPR
57,
58.B EXPR
59.sp 0
60ignore
61.B NAME
62.sp 0
63set
64.B NAME EXPR
65.RE
66.sp
67A
68.B NAME
69is a string. If it only contains letters, digits and underscores, it does not
70have to quoted; in all other cases, you should use double quotes around it.
71Within quotes, you can use the normal escape\-codes from C.
72
73A
74.B NAME\-LIST
75is one or more
76.B NAME
77items behind each other, separated by whitespace.
78
79A
80.B EXPR
81is of one of the below forms:
82
83.RS
84.B NUMBER
85.sp 0
86.B NAME
87.sp 0
88@
89.sp 0
90.B EXPR
91+
92.B EXPR
93.sp 0
94.B EXPR
95\-
96.B EXPR
97.sp 0
98.B EXPR
99*
100.B EXPR
101.sp 0
102.B EXPR
103/
104.B EXPR
105.sp 0
106\-
107.B EXPR
108.sp 0
109(
110.B EXPR
111)
112.RE
113
114A
115.B NUMBER
116is a floating\-point number. `10', `10.4' and `.4' are examples of valid
117floating\-point numbers; `10.' or `10E4' are not valid.
118
119.SH SEMANTICS
120
121This section describes the meaning of each statement. Each statement is
122accompanied by an example line. Please ignore line wrap\-arounds.
123
124.SS BUS STATEMENT
125
126.RS
127bus "i2c\-0" "SMBus PIIX4 adapter at e800"
128.RE
129
130A
131.I bus
132statement binds the description of an I2C or SMBus adapter to a bus number.
133This makes it possible to refer to an adapter in the configuration file,
134independent of the actual correspondence of bus numbers and actual
135adapters (which may change from moment to moment).
136
137The first argument is the bus number. It is the literal text
138.IR i2c\- ,
139followed by a number. As there is a dash in this argument, it must
140always be quoted.
141
142The second argument is the adapter name, it must match exactly the
143adapter name as it appears in
144.I /proc/bus/i2c
145(2.4 kernel)
146or
147.I /sys/class/i2c-adapter/i2c-*/device/name
148(2.6 kernel).
149It should always be quoted as well as it will most certainly contain
150spaces or dashes.
151
152The
153.I bus
154statements may be scattered randomly throughout the configuration file;
155there is no need to place the bus line before the place where its binding
156is referred to. Still, as a matter of good style, we suggest you place
157all
158.I bus
159statements together at the top of your configuration file.
160
161The program
162.I prog/config/grab_busses.sh
163in the source distribution can help you generate these lines.
164
165.SS CHIP STATEMENT
166
167.RS
168chip "lm78\-*" "lm79\-*"
169.RE
170
171The
172.I chip
173statement selects for which chips all following configuration
174statements are meant. The chip selection remains valid until the next
175.I chip
176statement. It does not influence the operation of a
177.I bus
178statement.
179
180If a chip matches at least one of the chip descriptions, all following
181configuration lines are examined for it. If it matches none of the
182chip descriptions, every
183.RI non\- bus
184statement is ignored upto the next
185.I chip
186statement.
187
188A chip description is built from a couple of elements, separated by
189dashes.
190
191The first element is the name of the chip type. Sometimes a single driver
192implements several chip types, with several names. The driver documentation
193should tell you. You may substitute the wildcard operator
194.I *
195for this element.
196
197The second element is the name of the bus. This is either
198.IR isa ,
199.I pci
200or
201.IR i2c-N ,
202with
203.I N
204being any number as binded with a
205.I bus
206statement. You may substitute the wildcard operator
207.I *
208for this element, or only for the number of the I2C bus
209(which means 'any I2C bus').
210
211The third element is the hexadecimal address of the chip. The valid range
212depends on the bus type. You may substitute
213the wildcard operator
214.I *
215for this element.
216
217Note that it wouldn't make any sense to specify the address without the
218bus type. For this reason, the address part is plain omitted when the bus
219type isn't specified.
220The following are all valid chip type specification based on
221.I lm78\-i2c\-1\-2d
222or
223.IR lm78\-isa\-0290 :
224
225.RS
226lm78\-i2c\-1\-2d
227.sp 0
228lm78\-i2c\-1\-*
229.sp 0
230lm78\-i2c\-*\-2d
231.sp 0
232lm78\-i2c\-*\-*
233.sp 0
234lm78\-isa\-0290
235.sp 0
236lm78\-isa\-*   
237.sp 0
238lm78\-*       
239.sp 0
240*\-i2c\-1\-2d
241.sp 0
242*\-i2c\-1\-*
243.sp 0
244*\-i2c\-*\-2d
245.sp 0
246*\-i2c-*\-*
247.sp 0
248*\-isa\-0290
249.sp 0
250*\-isa\-*
251.RE
252
253.SS COMPUTE STATEMENT
254.RS
255compute in3 ((6.8/10)+1)*@ ,  @/((6.8/10)+1)
256.RE
257
258The
259.I compute
260statement describes how you should translate a feature's raw value to a
261real\-world value, and how you should translate it back to a raw value again.
262
263The first argument is the feature name, which may be the name of a feature
264class (see below). The second is an expression which specifies how a
265raw value must be translated to a real\-world value; `@' stands here for
266the raw value. The third is an expression that specifies how a real\-world
267value should be translated back to a raw value; `@' stands here for the
268real\-world value.
269
270You may use the name of other features in these expressions; you should be
271careful though to avoid circular references, as this may hang the expression
272evaluator.
273
274If at any moment a translation between a raw and a real\-world value is
275called for, but no
276.I compute
277statement applies, a one\-on\-one translation is used instead.
278
279The comma is an unfortunate necessity to stop the statement from becoming
280ambiguous.
281
282.SS IGNORE STATEMENT
283.RS
284ignore fan1
285.RE
286
287The
288.I ignore
289statement is a hint that a specific feature should be ignored - probably
290because it returns bogus values (for example, because a fan or temperature
291sensor is not connected).
292
293The only argument is the feature name, which may be a feature class;
294in that case the label class is used (see below).
295
296.SS LABEL STATEMENT
297.RS
298label in3 "+5V"
299.RE
300
301The
302.I label
303statement describes how a feature should be called. Features without a
304.I label
305statement are just called by their feature name. Applications can use this
306to label the readings they present (but they don't have to).
307
308The first argument is the feature name, which may be a feature class (see
309below). The second argument is the feature description.
310
311.SS SET STATEMENT
312.RS
313set in3_min  5 * 0.95
314.RE
315
316The
317.I set
318statement gives an initial value for a feature. Not each feature can be
319given a sensible initial value; valid features are usually min/max limits.
320
321The first argument is the feature name. The second argument is an expression
322which determines the initial value. If there is an applying
323.I compute
324statement, this value is fed to its third argument to translate it to a
325raw value.
326
327You may use the name of other features in these expressions; current readings
328are substituted. You should be careful though to avoid circular references,
329as this may hang the expression evaluator. Also, you can't be sure in which
330order
331.I set
332statements are evaluated, so this can lead to nasty surprises.
333
334.SH FEATURE CLASSES
335
336There are two kinds of classes, here called
337.I compute
338and
339.I label
340classes, after the statements for which they are defined. Classes are
341defined over features: the kind of values that can be read from or set
342for a specific kind of chip.
343
344Each class has a class name, which is usually the same as its most
345prominent feature. A
346.I label
347or
348.I compute
349statement for the class name feature forces the same settings for all other
350class members. A specific statement for a class member feature always
351overrides the general class setting, though. This means that you can't
352override the class name feature explicitly.
353
354A simple example will explain this better. The
355.I fan1
356label class of the
357.I lm78
358chip contains three members:
359.I fan1
360itself,
361.I fan1_min
362and
363.IR fan1_div .
364The last feature sets the number by which readings are divided (to give the
365fan less resolution, but a larger field of operation). The following
366line will set the name of all these features to describe the fan:
367.RS
368label fan1 "Processor 1 FAN"
369.RE
370Now we happen to know that, due to the type of fan we use, all readings
371are always off by a factor of two (some fans only return one 'tick' each
372rotation, others return two):
373.RS
374compute fan1 @/2 , @*2
375.RE
376It will be clear that this should be done for the
377.I fan1_min
378feature too, but not for the
379.I fan1_div
380feature! Fortunately, the
381.I fan1
382compute class contains
383.IR fan1_min ,
384but not
385.IR fan1_div ,
386so this works out right.
387
388.SH WHICH STATEMENT APPLIES
389
390If more than one statement of the same kind applies at a certain moment,
391the last one in the configuration file is used. So usually, you should
392put more genereal
393.I chip
394statements at the top, so you can overrule them below.
395
396There is one exception to this rule: if a statement only applies because
397the feature is in the same class as the feature the statement contains,
398and there is anywhere else a statement for this specific class member,
399that one takes always precedence.
400
401.SH "CONFORMING TO"
402lm_sensors-2.x
403.SH SEE ALSO
404libsensors(3)
405
406.SH AUTHOR
407Frodo Looijaard and the lm_sensors group
408http://www.lm-sensors.org/
409
410
411
Note: See TracBrowser for help on using the browser.