Changeset 5534

Show
Ignore:
Timestamp:
12/07/08 14:14:39 (3 years ago)
Author:
khali
Message:

Move the help section of sensors.conf.eg to sensors.conf.5, so that
we have only one document to maintain. This change also speeds up
sensors by 2.5% when using the default configuration file.

Location:
lm-sensors/branches/lm-sensors-3.0.0
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/branches/lm-sensors-3.0.0/CHANGES

    r5532 r5534  
    99  sensors: Add support for instantaneous power sensors 
    1010           Add support for current sensors 
     11  sensors.conf.8: Lots of additions and reworks 
    1112  sensors.conf.eg: The LM99 offset is now handled in the lm90 driver 
     13                   Move help section to sensors.conf.5 
    1214  sensors-detect: Fix detection of ADT7463 and LM96000 
    1315                  Add VIA VX800/VX820 support  
  • lm-sensors/branches/lm-sensors-3.0.0/etc/sensors.conf.eg

    r5531 r5534  
    1 # Sensors configuration file used by 'libsensors' 
    2 #------------------------------------------------ 
    3 # 
    4 ########################################################################## 
    5 #                                                                        # 
    6 #    PLEASE READ THIS HELPFUL HINT!!!                                    # 
    7 #                                                                        # 
    8 #       The 'set' lines (generally for min and max values)               # 
    9 #       do not take effect until you run 'sensors -s' as root !!!        # 
    10 #       We suggest you put 'sensors -s' in a /etc/rc.d/... file          # 
    11 #       to be run at boot time after the modules are inserted !!!        # 
    12 #                                                                        # 
    13 ########################################################################## 
    14 # 
    15 # 
    16 # OVERVIEW 
    17 # -------- 
    18 # This configuration file will be used by all userspace applications 
    19 # linked to libsensors. It is NOT used by the lm_sensors drivers directly. 
    20 # 
    21 # This config file consists of two parts: the heavily commented LM78 
    22 # example, and the real parts. Search for '####' if you want to skip 
    23 # to the real stuff. 
    24 # 
    25 # Hash marks introduce comments, which continue until the end of a line. 
    26 # 
    27 # Identifiers consisting of only digits and letters can be used 
    28 # unquoted; other identifiers must be quoted. Escape characters within 
    29 # quotes operate like those in C. 
    30 # 
    31 # 
    32 # CHIP LINES 
    33 # ---------- 
    34 # A 'chip' line specifies what the following 'label', 'compute', 'set' and 
    35 # 'ignore' lines refer to. In this case, until the 
    36 # next 'chip' line, everything refers to all lm78 and lm79 
    37 # chips. Other examples are *-isa-* for everything on the ISA bus, and 
    38 # lm78-i2c-*-4e for all lm78 chips on address 0x4e of any I2C bus. 
    39 # 
    40 # If more chip statements match a specific chip, they are all considered. 
    41 # Later lines overrule earlier lines, so if you set the in0 label for 
    42 # lm78-* to "This", and later on the in0 label for lm78-isa-* to "That", 
    43 # "That" is used for LM78 chips on the ISA bus, and "This" for LM78 
    44 # chips on a non-ISA bus. 
    45 # 
    46 #       chip "lm78-*" "lm79-*" 
    47 # 
    48 # 
    49 # FEATURE NAMES 
    50 # ------------- 
    51 # Feature names are used in 'label', 'compute', 'set', and 'ignore' lines. 
    52 # Example feature names are 'in0', 'temp2', 'in3_min', and 'temp3_max'. 
    53 # 
    54 # Undefined features will be silently ignored in 'label' and 'compute' lines. 
    55 # Undefined features in 'set' lines will result in 'Unknown feature name' 
    56 # when running 'sensors -s'. 
    57 # 
    58 # 
    59 # LABEL LINES 
    60 # ----------- 
    61 # A label line describes what a certain feature stands for on your 
    62 # mainboard. Programs can retrieve these names and display them. 
    63 # If no label is specified for a certain feature, the default name 
    64 # (ie. 'fan1' for fan1) is used. 
    65 # 
    66 # These are as advised in the LM78 and LM79 data sheets, and used on most 
    67 # boards we have seen. 
    68 # 
    69 #       label in0 "VCore 1" 
    70 #       label in1 "VCore 2" 
    71 #       label in2 "+3.3V" 
    72 #       label in3 "+5V" 
    73 #       label in4 "+12V" 
    74 #       label in5 "-12V" 
    75 #       label in6 "-5V" 
    76 # 
    77 # 
    78 # COMPUTE LINES 
    79 # ------------- 
    80 # A compute line describes how to scale a certain feature. There are 
    81 # two expressions in it: the first describes how the driver value must 
    82 # be translated to a user value, the second how a user value must be 
    83 # translated to a driver value. '@' is the value to operate on. You may 
    84 # refer to other readable features (like 'cpu0_vid * 1.05'). 
    85 # 
    86 # The following operators are valid: + - * / ( ) ^ ` 
    87 # ^ is e**x and ` is ln(x) 
    88 # 
    89 # Where it makes sense, compute lines are inherited by subfeatures. 
    90 # For example, the compute line for 'in0' is automatically applied to 
    91 # 'in0_min' and 'in0_max' as well. 
    92 # 
    93 # 
    94 # VOLTAGE COMPUTATION DETAILS 
    95 # --------------------------- 
    96 # Most voltage sensors in sensor chips have a range of 0 to 4.096 Volts. 
    97 # This is generally sufficient for the 3.3 and CPU (2.5V, for example) 
    98 # supply voltages, so the sensor chip reading is the actual voltage. 
    99 # 
    100 # Other supply voltages must be scaled with an external resistor network. 
    101 # The chip driver generally reports the 'raw' value 0 - 4.09 V, and the 
    102 # userspace application must convert this raw value to an actual voltage. 
    103 # The 'compute' lines provide this facility. 
    104 # 
    105 # Unfortunately the resistor values vary among motherboard types. 
    106 # Therefore you may have to adjust the computations in this file 
    107 # to match your motherboard. 
    108 # 
    109 # For positive voltages (in3, in4), two resistors are used, with the following 
    110 # formula (R1,R2: resistor values, Vs: read voltage, Vin: pin voltage) 
    111 #       R1 = R2 * (Vs/Vin - 1) 
    112 # For negative voltages (in5, in6) two resistors are used, with the following 
    113 # formula (Rin,Rf: resistor values, Vs: read voltage, Vin: pin voltage) 
    114 #       Rin = (Vs * Rf) / Vin 
    115 # 
    116 # Note: Some chips use a different formula, see it87 section for example. 
    117 # 
    118 # Here are the official LM78 and LM79 data sheet values. 
    119 #             Vs     R1,Rin   R2,Rf    Vin 
    120 #       in3   +5.0      6.8    10     +2.98 
    121 #       in4  +12.0     30      10     +3.00 
    122 #       in5  -12.0    240      60     +3.00 
    123 #       in6   -5.0    100      60     +3.00 
    124 # 
    125 # These would lead to these declarations: 
    126 #       compute in3 ((6.8/10)+1)*@ ,  @/((6.8/10)+1) 
    127 #       compute in4 ((30/10)+1)*@  ,  @/((30/10)+1) 
    128 #       compute in5 -(240/60)*@    ,  -@/(240/60) 
    129 #       compute in6 -(100/60)*@    ,  -@/(100/60) 
    130 # 
    131 # On almost any mainboard we have seen, the Winbond compute values lead to 
    132 # much better results, though. 
    133 # 
    134 #             Vs     R1,Rin   R2,Rf    Vin 
    135 #       in4  +12.0     28      10     +3.15 
    136 #       in5  -12.0    210      60.4   +3.45 
    137 #       in6   -5.0     90.9    60.4   +3.33 
    138 # 
    139 # These leads to these declarations: 
    140 #       compute in3 ((6.8/10)+1)*@ ,  @/((6.8/10)+1) 
    141 #       compute in4 ((28/10)+1)*@  ,  @/((28/10)+1) 
    142 #       compute in5 -(210/60.4)*@  ,  -@/(210/60.4) 
    143 #       compute in6 -(90.9/60.4)*@ ,  -@/(90.9/60.4) 
    144 # 
    145 # NOTE: On many motherboards, the -5V and -12V sensors are not connected. 
    146 # Add ignore lines so these readings will not be displayed. For example: 
    147 #       ignore in5 
    148 #       ignore in6 
    149 # 
    150 # 
    151 # TEMPERATURE COMPUTATION EXAMPLES 
    152 # -------------------------------- 
    153 # There are two common ways to adjust temperature readings. 
    154 # One is to adjust by a constant. The other is to change the 
    155 # temperature sensor type. 
    156 # 
    157 # Add 5 degrees to temperature sensor 1: 
    158 #       compute temp1 @+5,@-5 
    159 # 
    160 # Sensor type adjustments (certain chips only): 
    161 #       set temp1_type 1    # PII/Celeron Diode 
    162 #       set temp1_type 2    # 3904 transistor 
    163 #       set temp1_type 3    # thermal diode 
    164 #       set temp1_type 4    # thermistor 
    165 #       set temp1_type 5    # AMD AMDSI 
    166 #       set temp1_type 6    # Intel PECI 
    167 # 
    168 # Often, a temperature sensor is disconnected; disable it with an ignore line: 
    169 #       ignore temp3 
    170 # 
    171 # 
    172 # SET LINES 
    173 # --------- 
    174 # Set statements set things like limits. Complete expressions can be 
    175 # used. Not everything can sensibly be set: setting 'in0', for example, 
    176 # is impossible! These settings are put through the compute translations; 
    177 # so if we specify '12.8' for in6, '3.2' will actually be written! 
    178 # 
    179 # Important note: In the 'sensors' program, these only take effect 
    180 # after running 'sensors -s'!!! 
    181 # 
    182 # Here are some examples: 
    183 # 
    184 #       set in0_max cpu0_vid*1.05 
    185 #       set in0_min cpu0_vid*0.95 
    186 #       set temp1_max 40 
    187 #       set temp1_max_hyst 37 
    188 # 
    189 # Think of tempx_max as 'alarm set' and tempx_max_hyst as 'alarm clear' 
    190 # thresholds. In most cases the 'max' value should be higher than 
    191 # the 'max_hyst' value by several degrees. Obviously, having them equal 
    192 # disables the hysteresis mechanism. 
    193 # 
     1# libsensors configuration file 
     2# ----------------------------- 
     3# NOTE: 
    1944# All the set statements from this file are commented out by default. 
    1955# The reason is that the proper limits are highly system-dependent, 
    1966# and writing improper limits may have all sorts of weird effects, 
    1977# from beeping to CPU throttling to instant reboot. If you want to 
    198 # actually set the limits, remove the comment marks. 
    199 # 
    200 # 
    201 # IGNORE LINES 
    202 # ------------ 
    203 # Ignore statements tell certain features are not wanted. As with compute 
    204 # statements, 'ignore in0' would also invalidate 'in0_max' and 'in0_min'. 
    205 # 'ignore' does not disable anything in the actual sensor chip; it 
    206 # simply prevents the user program from accessing that data. 
    207 # 
    208 #       ignore in0 
    209 # 
    210 # 
    211 # STATEMENT ORDER 
    212 # --------------- 
    213 # Statements can go in any order, EXCEPT that some statements depend 
    214 # on others. Dependencies could be either in the library or the driver. 
    215 # A 'compute' statement must go before a 'set' statement 
    216 # for the same feature or else the 'set' won't be computed correctly. 
    217 # This is a library dependency. 
    218 # A 'set fan1_div' statement must go before a 'set fan1_min' statement, 
    219 # because the driver uses the divisor in calculating the minimum. 
    220 # 
    221 # 
    222 # BUS LINES 
    223 # --------- 
    224 # There is one other feature: the 'bus' statement. An example is below. 
    225 # 
    226 #       bus "i2c-0" "SMBus PIIX4 adapter at e800" 
    227 # 
    228 # If we refer from now on to 'i2c-0' in 'chip' lines, this will run-time 
    229 # be matched to this bus. So even if the PIIX4 is called 'i2c-5' at that 
    230 # moment, because five other adapters were detected first, 'i2c-0' in 
    231 # the config file would always only match this physical bus. In the above 
    232 # config file, this feature is not needed; but the next lines would 
    233 # only affect the LM75 chips on the PIIX4 adapter: 
    234 # 
    235 #       chip "lm75-i2c-0-*" 
    236 # 
    237 # You can use "sensors --bus-list" to generate bus lines for your system. 
    238 # 
    239 # 
    240 # BEEPS 
    241 # ----- 
    242 # Some chips support alarms with beep warnings. When an alarm is triggered 
    243 # you can be warned by a beeping signal through your computer speaker. It 
    244 # is possible to enable beeps for all alarms on a chip using the following 
    245 # line: 
    246 # 
    247 #       set beep_enable 1 
    248 # 
    249 # or disable them using: 
    250 # 
    251 #       set beep_enable 0 
    252 # 
    253 # 
    254 ########################################################################## 
    255 #### Here begins the real configuration file 
    256  
     8# actually set the limits, remove the comment marks, then run "sensors -s". 
    2579 
    25810chip "lm78-*" "lm79-*" "w83781d-*" 
  • lm-sensors/branches/lm-sensors-3.0.0/lib/sensors.conf.5

    r5340 r5534  
    1 .\" Copyright 1998, 1999 Adrian Baugh <adrian.baugh@keble.ox.ac.uk> and 
    2 .\" Frodo Looijaard <frodol@dds.nl> 
     1.\" Copyright (C) 1998, 1999 Adrian Baugh <adrian.baugh@keble.ox.ac.uk> and 
     2.\"                          Frodo Looijaard <frodol@dds.nl> 
     3.\" Copyright (C) 2008       Jean Delvare <khali@linux-fr.org> 
    34.\" 
    45.\" Permission is granted to make and distribute verbatim copies of this 
     
    910.\" manual under the conditions for verbatim copying, provided that the 
    1011.\" entire resulting derived work is distributed under the terms of a 
    11 .\" permission notice identical to this one 
     12.\" permission notice identical to this one. 
    1213.\"  
    1314.\" Since the Linux kernel and libraries are constantly changing, this 
    1415.\" manual page may be incorrect or out-of-date.  The author(s) assume no 
    1516.\" 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. 
     17.\" the use of the information contained herein. 
    2018.\"  
    2119.\" Formatted or processed versions of this manual, if unaccompanied by 
     
    2422.\" References consulted: 
    2523.\"     sensors.conf.eg by Frodo Looijaard 
    26 .TH sensors.conf 5  "October 2007" "lm-sensors 3" "Linux User's Manual" 
     24.TH sensors.conf 5  "December 2008" "lm-sensors 3" "Linux User's Manual" 
    2725.SH NAME 
    2826sensors.conf \- libsensors configuration file 
     
    3129sensors.conf describes how libsensors, and so all programs using it, should 
    3230translate the raw readings from the kernel modules to real\-world values. 
     31 
     32.SH SEMANTICS 
     33 
     34On a given system, there may be one or more hardware monitoring chips. 
     35Each chip may have several features. For example, the LM78 monitors 7 
     36voltage inputs, 3 fans and one temperature. Feature names are 
     37standardized. Typical feature names are in0, in1, in2... for voltage 
     38inputs, fan1, fan2, fan3... for fans and temp1, temp2, temp3... for 
     39temperature inputs. 
     40 
     41Each feature may in turn have one or more sub\-features, each 
     42representing an attribute of the feature: input value, low limit, high 
     43limit, alarm, etc. Sub\-feature names are standardized as well. For 
     44example, the first voltage input (in0) would typically have 
     45sub\-features in0_input (measured value), in0_min (low limit), in0_max 
     46(high limit) and in0_alarm (alarm flag). Which sub\-features are 
     47actually present depend on the exact chip type. 
     48 
     49The 
     50.I sensors.conf 
     51configuration file will let you configure each chip, feature and 
     52sub\-feature in a way that makes sense for your system. 
     53 
     54The rest of this section describes the meaning of each configuration 
     55statement. 
     56 
     57.SS CHIP STATEMENT 
     58 
     59A 
     60.I chip 
     61statement selects for which chips all following 
     62.IR compute , 
     63.IR label , 
     64.I ignore 
     65and 
     66.I set 
     67statements are meant. A chip 
     68selection remains valid until the next 
     69.I chip 
     70statement. Example: 
     71 
     72.RS 
     73chip "lm78\-*" "lm79\-*" 
     74.RE 
     75 
     76If a chip matches at least one of the chip descriptions, the following 
     77configuration lines are examined for it, otherwise they are ignored. 
     78 
     79A chip description is built from several elements, separated by 
     80dashes. The first element is the chip type, the second element is 
     81the name of the bus, and the third element is the hexadecimal address 
     82of the chip. Such chip descriptions are printed by sensors(1) as the 
     83first line for every chip. 
     84 
     85The name of the bus is either 
     86.IR isa , 
     87.IR pci , 
     88.IR virtual , 
     89.I spi-* 
     90or 
     91.I i2c-N 
     92with  
     93.I N 
     94being a bus number as binded with a  
     95.I bus 
     96statement. This list isn't necessarily exhaustive as support for other 
     97bus types may be added in the future. 
     98 
     99You may substitute the wildcard operator 
     100.I * 
     101for every element. Note however that it wouldn't make any sense to specify 
     102the address without the bus type, so the address part is plain omitted 
     103when the bus type isn't specified. 
     104Here is how you would express the following matches: 
     105 
     106.TS 
     107l l. 
     108LM78 chip at address 0x2d on I2C bus 1  lm78\-i2c\-1\-2d 
     109LM78 chip at address 0x2d on any I2C bus        lm78\-i2c\-*\-2d 
     110LM78 chip at address 0x290 on the ISA bus       lm78\-isa\-0290 
     111Any LM78 chip on I2C bus 1      lm78\-i2c\-1\-* 
     112Any LM78 on any I2C bus lm78\-i2c\-*\-* 
     113Any LM78 chip on the ISA bus    lm78\-isa\-* 
     114Any LM78 chip   lm78\-* 
     115Any chip at address 0x2d on I2C bus 1   *\-i2c\-1\-2d 
     116Any chip at address 0x290 on the ISA bus        *\-isa\-0290 
     117.TE 
     118 
     119If several chip statements match a specific chip, they are all considered. 
     120 
     121.SS LABEL STATEMENT 
     122 
     123A 
     124.I label 
     125statement describes how a feature should be called. Features without a 
     126.I label 
     127statement are just called by their feature name. Applications can use this 
     128to label the readings they present. Example: 
     129 
     130.RS 
     131label in3 "+5V" 
     132.RE 
     133 
     134The first argument is the feature name. The second argument is the feature 
     135description. 
     136 
     137.SS IGNORE STATEMENT 
     138 
     139An  
     140.I ignore 
     141statement is a hint that a specific feature should be ignored - probably 
     142because it returns bogus values (for example, because a fan or temperature 
     143sensor is not connected). Example: 
     144 
     145.RS 
     146ignore fan1 
     147.RE 
     148 
     149The only argument is the feature name. Please note that this does not disable 
     150anything in the actual sensor chip; it simply hides the feature in question 
     151from libsensors users. 
     152 
     153.SS COMPUTE STATEMENT 
     154 
     155A  
     156.I compute 
     157statement describes how a feature's raw value should be translated to a 
     158real\-world value, and how a real\-world value should be translated back 
     159to a raw value again. This is most useful for voltage sensors, because 
     160in general sensor chips have a limited range and voltages outside this 
     161range must be divided (using resistors) before they can be monitored. 
     162Example: 
     163 
     164.RS 
     165compute in3 ((6.8/10)+1)*@, @/((6.8/10)+1) 
     166.RE 
     167 
     168The example above expresses the fact that the voltage input is divided 
     169using two resistors of values 6.8 Ohm and 10 Ohm, respectively. See the 
     170.B VOLTAGE COMPUTATION DETAILS 
     171section below for details. 
     172 
     173The first argument is the feature name. The second argument is an expression 
     174which specifies how a raw value must be translated to a real\-world value; 
     175`@' stands here for the raw value. This is the formula which will be applied 
     176when reading values from the chip. The third argument is an expression that 
     177specifies how a real\-world value should be translated back to a raw value; 
     178`@' stands here for the real\-world value. This is the formula which will be 
     179applied when writing values to the chip. The two formulas are obviously 
     180related, and are seperated by a comma. 
     181 
     182A 
     183.I compute 
     184statement applies to all sub\-features of the target feature for which 
     185it makes sense. For example, the above example would affect sub\-features 
     186in3_min and in3_max (which are voltage values) but not in3_alarm 
     187(which is a boolean flag.) 
     188 
     189The following operators are supported in 
     190.I compute 
     191statements: 
     192.RS 
     193+ \- * / ( ) ^ ` 
     194.RE 
     195^x means exp(x) and `x means ln(x). 
     196 
     197You may use the name of sub\-features in these expressions; current readings 
     198are substituted. You should be careful though to avoid circular references. 
     199 
     200If at any moment a translation between a raw and a real\-world value is 
     201called for, but no  
     202.I compute 
     203statement applies, a one\-on\-one translation is used instead. 
     204 
     205.SS SET STATEMENT 
     206 
     207A 
     208.I set 
     209statement is used to write a sub\-feature value to the chip. Of course not 
     210all sub\-feature values can be set that way, in particular input values 
     211and alarm flags can not. Valid sub\-features are usually min/max limits. 
     212Example: 
     213 
     214.RS 
     215set in3_min  5 * 0.95 
     216.RE 
     217.RS 
     218set in3_max  5 * 1.05 
     219.RE 
     220 
     221The example above basically configures the chip to allow a 5% deviance 
     222for the +5V power input. 
     223 
     224The first argument is the feature name. The second argument is an expression 
     225which determines the written value. If there is an applying  
     226.I compute 
     227statement, this value is fed to its third argument to translate it to a 
     228raw value.  
     229 
     230You may use the name of sub\-features in these expressions; current readings 
     231are substituted. You should be careful though to avoid circular references. 
     232 
     233Please note that 
     234.I set 
     235statements are only executed by sensors(1) when you use the 
     236.B \-s 
     237option. Typical graphical sensors applications do not care about these 
     238statements at all. 
     239 
     240.SS BUS STATEMENT 
     241 
     242A 
     243.I bus 
     244statement binds the description of an I2C or SMBus adapter to a bus number.  
     245This makes it possible to refer to an adapter in the configuration file, 
     246independent of the actual correspondence of bus numbers and actual 
     247adapters (which may change from moment to moment). Example: 
     248 
     249.RS 
     250bus "i2c\-0" "SMBus PIIX4 adapter at e800" 
     251.RE 
     252 
     253The first argument is the bus number. It is the literal text 
     254.IR i2c\- , 
     255followed by a number. As there is a dash in this argument, it must 
     256always be quoted. 
     257 
     258The second argument is the adapter name, it must match exactly the 
     259adapter name as it appears in 
     260.IR /sys/class/i2c\-adapter/i2c\-*/name . 
     261It should always be quoted as well as it will most certainly contain 
     262spaces or dashes. 
     263 
     264The 
     265.I bus 
     266statements may be scattered randomly throughout the configuration file; 
     267there is no need to place the bus line before the place where its binding 
     268is referred to. Still, as a matter of good style, we suggest you place 
     269all 
     270.I bus 
     271statements together at the top of your configuration file. 
     272 
     273Running 
     274.B sensors --bus-list 
     275will generate these lines for you. 
     276 
     277.SS STATEMENT ORDER 
     278 
     279Statements can go in any order, however it is recommended to put 
     280`set fanX_div' statements before `set fanX_min' statements, in case 
     281a driver doesn't preserve the fanX_min setting when the fanX_div 
     282value is changed. Even if the driver does, it's still better to put 
     283the statements in this order to avoid accuracy loss. 
     284 
     285.SH VOLTAGE COMPUTATION DETAILS 
     286 
     287Most voltage sensors in sensor chips have a range of 0 to 4.08 V. 
     288This is generally sufficient for the +3.3V and CPU supply voltages, so 
     289the sensor chip reading is the actual voltage. 
     290 
     291Other supply voltages must be scaled with an external resistor network. 
     292The driver reports the value at the chip's pin (0 \- 4.08 V), and the 
     293userspace application must convert this raw value to an actual voltage. 
     294The 
     295.I compute 
     296statements provide this facility. 
     297 
     298Unfortunately the resistor values vary among motherboard types. 
     299Therefore you have to figure out the correct resistor values for your 
     300own motherboard. 
     301 
     302For positive voltages (typically +5V and +12V), two resistors are used, 
     303with the following formula: 
     304        R1 = R2 * (Vs/Vin \- 1) 
     305 
     306where: 
     307        R1 and R2 are the resistor values 
     308        Vs is the actual voltage being monitored 
     309        Vin is the voltage at the pin 
     310 
     311This leads to the following compute formula: 
     312        compute inX @*((R1/R2)+1),  @/(((R1/R2)+1) 
     313 
     314Real\-world formula for +5V and +12V would look like: 
     315        compute in3 @*((6.8/10)+1), @/((6.8/10)+1) 
     316        compute in4 @*((28/10)+1),  @/((28/10)+1) 
     317 
     318For negative voltages (typically \-5V and \-12V), two resistors are used 
     319as well, but different boards use different strategies to bring the 
     320voltage value into the 0 \- 4.08 V range. Some use an inverting 
     321amplifier, others use a positive reference voltage. This leads to 
     322different computation formulas. Note that most users won't have to care 
     323because most modern motherboards make little use of \-12V and no use of 
     324\-5V so they do not bother monitoring these voltage inputs. 
     325 
     326Real\-world examples for the inverting amplifier case: 
     327        compute in5 \-@*(240/60), \-@/(240/60) 
     328        compute in6 \-@*(100/60), \-@/(100/60) 
     329 
     330Real\-world examples for the positive voltage reference case: 
     331        compute in5 @*(1+232/56) \- 4.096*232/56, (@ + 4.096*232/56)/(1+232/56) 
     332        compute in6 @*(1+120/56) \- 4.096*120/56, (@ + 4.096*120/56)/(1+120/56) 
     333 
     334Many recent monitoring chips have a 0 \- 2.04 V range, so scaling resistors 
     335are even more needed, and resistor values are different. 
     336 
     337There are also a few chips out there which have internal scaling 
     338resistors, meaning that their value is known and doesn't change from 
     339one motherboard to the next. For these chips, the driver usually 
     340handles the scaling so it is transparent to the user and no 
     341.I compute 
     342statements are needed. 
     343 
     344.SH TEMPERATURE CONFIGURATION 
     345 
     346On top of the usual features, temperatures can have two specific 
     347sub\-features: temperature sensor type (tempX_type) and hysteresis 
     348values (tempX_max_hyst and tempX_crit_hyst). 
     349 
     350.SS THERMAL SENSOR TYPES 
     351 
     352Available thermal sensor types: 
     353.TS 
     354r l. 
     3551       PII/Celeron Diode 
     3562       3904 transistor 
     3573       thermal diode 
     3584       thermistor 
     3595       AMD AMDSI 
     3606       Intel PECI 
     361.TE 
     362 
     363For example, to set temp1 to thermistor type, use: 
     364 
     365.RS 
     366set temp1_type 4 
     367.RE 
     368 
     369Only certain chips support thermal sensor type change, and even these 
     370usually only support some of the types above. Please refer to the 
     371specific driver documentation to find out which types are supported 
     372by your chip. 
     373 
     374In theory, the BIOS should have configured the sensor types correctly, 
     375so you shouldn't have to touch them, but sometimes it isn't the case. 
     376 
     377.SS THERMAL HYSTERESIS MECHANISM 
     378 
     379Many monitoring chips do not handle the high and critical temperature 
     380limits as simple limits. Instead, they have two values for each 
     381limit, one which triggers an alarm when the temperature rises and another 
     382one which clears the alarm when the temperature falls. The latter is 
     383typically a few degrees below the former. This mechanism is known as 
     384hysteresis. 
     385 
     386The reason for implementing things that way is that high temperature 
     387alarms typically trigger an action to attempt to cool the system down, 
     388either by scaling down the CPU frequency, or by kicking in an extra 
     389fan. This should normally let the temperature fall in a timely manner. 
     390If this was clearing the alarm immediately, then the system would be 
     391back to its original state where the temperature rises and the alarm 
     392would immediately trigger again, causing an undesirable tight fan on, 
     393fan off loop. The hysteresis mechanism ensures that the system is 
     394really cool before the fan stops, so that it will not have to kick in 
     395again immediately. 
     396 
     397So, in addition to tempX_max, many chips have a tempX_max_hyst 
     398sub-feature. Likewise, tempX_crit often comes with tempX_max_crit. 
     399Example: 
     400 
     401.RS 
     402set temp1_max      60 
     403.RE 
     404.RS 
     405set temp1_max_hyst 56 
     406.RE 
     407 
     408The hysteresis mechanism can be disabled by giving both limits the same 
     409value. 
     410 
     411.SH BEEPS 
     412 
     413Some chips support alarms with beep warnings. When an alarm is triggered 
     414you can be warned by a beeping signal through your computer speaker. On 
     415top of per\-feature beep flags, there is usually a master beep control 
     416switch to enable or disable beeping globally. Enable beeping using: 
     417 
     418.RS 
     419set beep_enable 1 
     420.RE 
     421 
     422or disable it using: 
     423 
     424.RS 
     425set beep_enable 0 
     426.RE 
     427 
     428.SH WHICH STATEMENT APPLIES 
     429 
     430If more than one statement of the same kind applies at a certain moment, 
     431the last one in the configuration file is used. So usually, you should 
     432put more general 
     433.I chip 
     434statements at the top, so you can overrule them below. 
    33435 
    34436.SH SYNTAX 
     
    68470.B NAME 
    69471is a string. If it only contains letters, digits and underscores, it does not 
    70 have to quoted; in all other cases, you should use double quotes around it. 
     472have to be quoted; in all other cases, you must use double quotes around it. 
    71473Within quotes, you can use the normal escape\-codes from C. 
    72474 
     
    107509.B EXPR 
    108510.sp 0 
     511^ 
     512.B EXPR 
     513.sp 0 
     514`  
     515.B EXPR 
     516.sp 0 
    109517(  
    110518.B EXPR  
     
    116524is a floating\-point number. `10', `10.4' and `.4' are examples of valid 
    117525floating\-point numbers; `10.' or `10E4' are not valid. 
    118  
    119 .SH SEMANTICS 
    120  
    121 This section describes the meaning of each statement. Each statement is 
    122 accompanied by an example line. Please ignore line wrap\-arounds. 
    123  
    124 .SS BUS STATEMENT 
    125  
    126 .RS 
    127 bus "i2c\-0" "SMBus PIIX4 adapter at e800" 
    128 .RE 
    129  
    130 A 
    131 .I bus 
    132 statement binds the description of an I2C or SMBus adapter to a bus number.  
    133 This makes it possible to refer to an adapter in the configuration file, 
    134 independent of the actual correspondence of bus numbers and actual 
    135 adapters (which may change from moment to moment). 
    136  
    137 The first argument is the bus number. It is the literal text 
    138 .IR i2c\- , 
    139 followed by a number. As there is a dash in this argument, it must 
    140 always be quoted. 
    141  
    142 The second argument is the adapter name, it must match exactly the 
    143 adapter name as it appears in 
    144 .IR /sys/class/i2c-adapter/i2c-*/name . 
    145 It should always be quoted as well as it will most certainly contain 
    146 spaces or dashes. 
    147  
    148 The 
    149 .I bus 
    150 statements may be scattered randomly throughout the configuration file; 
    151 there is no need to place the bus line before the place where its binding 
    152 is referred to. Still, as a matter of good style, we suggest you place 
    153 all 
    154 .I bus 
    155 statements together at the top of your configuration file. 
    156  
    157 Running 
    158 .B sensors --bus-list 
    159 will generate these lines for you. 
    160  
    161 .SS CHIP STATEMENT 
    162  
    163 .RS 
    164 chip "lm78\-*" "lm79\-*" 
    165 .RE 
    166  
    167 The  
    168 .I chip 
    169 statement selects for which chips all following configuration 
    170 statements are meant. The chip selection remains valid until the next 
    171 .I chip 
    172 statement. It does not influence the operation of a 
    173 .I bus 
    174 statement. 
    175  
    176 If a chip matches at least one of the chip descriptions, all following 
    177 configuration lines are examined for it. If it matches none of the 
    178 chip descriptions, every  
    179 .RI non\- bus 
    180 statement is ignored upto the next 
    181 .I chip 
    182 statement. 
    183  
    184 A chip description is built from a couple of elements, separated by 
    185 dashes. 
    186  
    187 The first element is the name of the chip type. Sometimes a single driver 
    188 implements several chip types, with several names. The driver documentation 
    189 should tell you. You may substitute the wildcard operator 
    190 .I * 
    191 for this element. 
    192  
    193 The second element is the name of the bus. This is either 
    194 .IR isa , 
    195 .I pci 
    196 or 
    197 .IR i2c-N , 
    198 with  
    199 .I N 
    200 being any number as binded with a  
    201 .I bus 
    202 statement. You may substitute the wildcard operator 
    203 .I * 
    204 for this element, or only for the number of the I2C bus 
    205 (which means 'any I2C bus'). 
    206  
    207 The third element is the hexadecimal address of the chip. The valid range 
    208 depends on the bus type. You may substitute 
    209 the wildcard operator 
    210 .I * 
    211 for this element.  
    212  
    213 Note that it wouldn't make any sense to specify the address without the 
    214 bus type. For this reason, the address part is plain omitted when the bus 
    215 type isn't specified. 
    216 The following are all valid chip type specification based on 
    217 .I lm78\-i2c\-1\-2d 
    218 or 
    219 .IR lm78\-isa\-0290 : 
    220  
    221 .RS 
    222 lm78\-i2c\-1\-2d 
    223 .sp 0 
    224 lm78\-i2c\-1\-* 
    225 .sp 0 
    226 lm78\-i2c\-*\-2d 
    227 .sp 0 
    228 lm78\-i2c\-*\-* 
    229 .sp 0 
    230 lm78\-isa\-0290 
    231 .sp 0 
    232 lm78\-isa\-*     
    233 .sp 0 
    234 lm78\-*        
    235 .sp 0 
    236 *\-i2c\-1\-2d 
    237 .sp 0 
    238 *\-i2c\-1\-* 
    239 .sp 0 
    240 *\-i2c\-*\-2d 
    241 .sp 0 
    242 *\-i2c-*\-* 
    243 .sp 0 
    244 *\-isa\-0290 
    245 .sp 0 
    246 *\-isa\-* 
    247 .RE 
    248  
    249 .SS COMPUTE STATEMENT 
    250 .RS 
    251 compute in3 ((6.8/10)+1)*@ ,  @/((6.8/10)+1) 
    252 .RE 
    253  
    254 The  
    255 .I compute 
    256 statement describes how you should translate a feature's raw value to a 
    257 real\-world value, and how you should translate it back to a raw value again. 
    258  
    259 The first argument is the feature name, which may be the name of a feature 
    260 class (see below). The second is an expression which specifies how a 
    261 raw value must be translated to a real\-world value; `@' stands here for  
    262 the raw value. The third is an expression that specifies how a real\-world 
    263 value should be translated back to a raw value; `@' stands here for the 
    264 real\-world value. 
    265  
    266 You may use the name of other features in these expressions; you should be 
    267 careful though to avoid circular references, as this may hang the expression 
    268 evaluator. 
    269  
    270 If at any moment a translation between a raw and a real\-world value is 
    271 called for, but no  
    272 .I compute 
    273 statement applies, a one\-on\-one translation is used instead. 
    274  
    275 The comma is an unfortunate necessity to stop the statement from becoming 
    276 ambiguous. 
    277  
    278 .SS IGNORE STATEMENT 
    279 .RS 
    280 ignore fan1 
    281 .RE 
    282  
    283 The  
    284 .I ignore 
    285 statement is a hint that a specific feature should be ignored - probably 
    286 because it returns bogus values (for example, because a fan or temperature 
    287 sensor is not connected). 
    288  
    289 The only argument is the feature name, which may be a feature class; 
    290 in that case the label class is used (see below). 
    291  
    292 .SS LABEL STATEMENT 
    293 .RS 
    294 label in3 "+5V" 
    295 .RE 
    296  
    297 The 
    298 .I label 
    299 statement describes how a feature should be called. Features without a 
    300 .I label 
    301 statement are just called by their feature name. Applications can use this 
    302 to label the readings they present (but they don't have to). 
    303  
    304 The first argument is the feature name, which may be a feature class (see 
    305 below). The second argument is the feature description. 
    306  
    307 .SS SET STATEMENT 
    308 .RS 
    309 set in3_min  5 * 0.95 
    310 .RE 
    311  
    312 The 
    313 .I set 
    314 statement gives an initial value for a feature. Not each feature can be 
    315 given a sensible initial value; valid features are usually min/max limits. 
    316  
    317 The first argument is the feature name. The second argument is an expression 
    318 which determines the initial value. If there is an applying  
    319 .I compute 
    320 statement, this value is fed to its third argument to translate it to a 
    321 raw value.  
    322  
    323 You may use the name of other features in these expressions; current readings 
    324 are substituted. You should be careful though to avoid circular references,  
    325 as this may hang the expression evaluator. Also, you can't be sure in which 
    326 order  
    327 .I set 
    328 statements are evaluated, so this can lead to nasty surprises. 
    329  
    330 .SH FEATURE CLASSES 
    331  
    332 There are two kinds of classes, here called 
    333 .I compute 
    334 and 
    335 .I label 
    336 classes, after the statements for which they are defined. Classes are 
    337 defined over features: the kind of values that can be read from or set 
    338 for a specific kind of chip. 
    339  
    340 Each class has a class name, which is usually the same as its most  
    341 prominent feature. A  
    342 .I label 
    343 or 
    344 .I compute 
    345 statement for the class name feature forces the same settings for all other 
    346 class members. A specific statement for a class member feature always 
    347 overrides the general class setting, though. This means that you can't 
    348 override the class name feature explicitly. 
    349  
    350 A simple example will explain this better. The 
    351 .I fan1 
    352 label class of the  
    353 .I lm78 
    354 chip contains three members: 
    355 .I fan1 
    356 itself, 
    357 .I fan1_min 
    358 and  
    359 .IR fan1_div . 
    360 The last feature sets the number by which readings are divided (to give the 
    361 fan less resolution, but a larger field of operation). The following 
    362 line will set the name of all these features to describe the fan: 
    363 .RS 
    364 label fan1 "Processor 1 FAN" 
    365 .RE 
    366 Now we happen to know that, due to the type of fan we use, all readings 
    367 are always off by a factor of two (some fans only return one 'tick' each 
    368 rotation, others return two): 
    369 .RS 
    370 compute fan1 @/2 , @*2 
    371 .RE 
    372 It will be clear that this should be done for the  
    373 .I fan1_min  
    374 feature too, but not for the 
    375 .I fan1_div 
    376 feature! Fortunately, the  
    377 .I fan1 
    378 compute class contains  
    379 .IR fan1_min , 
    380 but not  
    381 .IR fan1_div , 
    382 so this works out right. 
    383  
    384 .SH WHICH STATEMENT APPLIES 
    385  
    386 If more than one statement of the same kind applies at a certain moment, 
    387 the last one in the configuration file is used. So usually, you should 
    388 put more general 
    389 .I chip 
    390 statements at the top, so you can overrule them below. 
    391  
    392 There is one exception to this rule: if a statement only applies because 
    393 the feature is in the same class as the feature the statement contains, 
    394 and there is anywhere else a statement for this specific class member, 
    395 that one takes always precedence. 
    396526 
    397527.SH FILES