Show
Ignore:
Timestamp:
09/23/06 11:32:29 (8 years ago)
Author:
khali
Message:

vt1211: Rework the voltage and temperature conversions and the temperature

input order to match the Linux 2.6 driver.

libsensors: Change vt1211 temp3-7 magnitude from 1 to 3.
sensors.conf.eg: Adjust the vt1211 section to match the new driver

interface.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/etc/sensors.conf.eg

    r4154 r4168  
    20382038 
    20392039chip "vt1211-*" 
    2040 # 
     2040 
    20412041#                                                       1 for temp, 0 for volt. 
    20422042#       Sensor          Voltage Mode    Temp Mode       config bit 
    20432043#       --------        ------------    ---------       -------------- 
    2044 #       Reading 1                       temp3 
    2045 #       Reading 3                       temp1            
    2046 #       UCH1/Reading2   in0             temp2           0x04 (4) 
     2044#       Reading 1                       temp1 
     2045#       Reading 3                       temp2            
     2046#       UCH1/Reading2   in0             temp3           0x04 (4) 
    20472047#       UCH2            in1             temp4           0x08 (8) 
    20482048#       UCH3            in2             temp5           0x10 (16) 
     
    20502050#       UCH5            in4             temp7           0x40 (64) 
    20512051#       3.3V            in5 
    2052 # 
    2053 # set uch1-2 to temp mode, uch3-5 to voltage mode 
    2054 # 
    2055 #   set config 12 
    2056     ignore in0 
    2057     ignore in1 
     2052 
     2053# Set uch1-2 to temp mode, uch3-5 to voltage mode. This works only  
     2054# for the 2.4 driver. For the 2.6 driver use the uch_config module parameter. 
     2055# If the value doesn't match the hardware wiring, you'll get weird readings! 
     2056#    set config 12 
     2057 
     2058# The 2.6 driver will automatically ignore the inputs which are not 
     2059# configured, but the 2.4 driver will not so you'll need to add ignore 
     2060# statements depending on the config value above. 
     2061#   ignore in0 
     2062#   ignore in1 
     2063#   ignore temp3 
     2064#   ignore temp4 
    20582065    ignore temp5 
    20592066    ignore temp6 
    20602067    ignore temp7 
    20612068 
    2062 # IMPORTANT: If you get "ERROR: Can't get TEMPX data!" from "sensors", 
    2063 # where X is 2, 4, 5, 6 or 7, although you have this UCH set to 
    2064 # temperature, this generally means that this UCH isn't (physically) 
    2065 # used for temperature, so you should add an ignore statement for tempX 
    2066 # and change the "config" value to reflect the fact that this UCH is 
    2067 # probably used for voltage. 
    2068  
    2069 #   label in0 "unused" 
    2070 #   label in1 "unused" 
    2071     label in2 "VCore1" 
     2069    label in0 "+3.3V" 
     2070    label in1 "+2.5V" 
     2071    label in2 "VCore" 
    20722072    label in3 "+5V" 
    20732073    label in4 "+12V" 
    20742074    label in5 "+3.3V" 
    20752075 
    2076     label temp1 "Int Temp" 
    2077     label temp2 "MB1 Temp" 
    2078     label temp3 "Proc Temp" 
    2079     label temp4 "MB2 Temp" 
    2080 # 
    2081 #   All voltage calculations have the form 
    2082 #       ((@ * 100) - 3) / (K * 95.8), (@ * K * 0.958) + .03 
    2083 #   where K = R2 / (R1 + R2). 
    2084 #   Use the following K values based on input voltage. 
    2085 #   This of course assumes the mobo has the resistors 
    2086 #   recommended by Via in the datasheet. 
    2087 #       Voltage                 K 
    2088 #       VCore                   1.0 
    2089 #       2.5                     0.8333 
    2090 #       3.3 (in5 internal)      0.6296 
    2091 #       3.5 (3.3V ext.)         0.5952 
    2092 #       5.0                     0.4167 
    2093 #       12.0                    0.1754 
    2094 # 
    2095 #   compute in0 ((@ * 100) - 3) / (0.5952 * 95.8), (@ * 0.5952 * 0.958) + .03 
    2096 #   compute in1 ((@ * 100) - 3) / (0.8333 * 95.8), (@ * 0.8333 * 0.958) + .03 
    2097     compute in2 ((@ * 100) - 3) / (0.5952 * 95.8), (@ * 0.5952 * 0.958) + .03 
    2098     compute in3 ((@ * 100) - 3) / (0.4167 * 95.8), (@ * 0.4167 * 0.958) + .03 
    2099     compute in4 ((@ * 100) - 3) / (0.1754 * 95.8), (@ * 0.1754 * 0.958) + .03 
    2100     compute in5 ((@ * 100) - 3) / (0.6296 * 95.8), (@ * 0.6296 * 0.958) + .03 
    2101  
    2102 # adjust this if your vid is wrong; see doc/vid 
     2076    label temp1 "CPU Temp" 
     2077    label temp2 "Int Temp" 
     2078 
     2079    label fan1 "Case Fan" 
     2080    label fan2 "CPU Fan" 
     2081 
     2082# All voltage calculations have the form 
     2083#    compute inX  @ * (1 + R1 / R2), @ / (1 + R1 / R2) 
     2084# 
     2085# The following are the resistor values as recommended by VIA 
     2086#       Voltage         R1      R2 
     2087#       -------         ----    ---- 
     2088#       VCore           -       -       (no scaling) 
     2089#        3.3            6.8k    10k 
     2090#        2.5            2k      10k 
     2091#        5.0            14k     10k 
     2092#       12.0            47k     10k 
     2093# 
     2094# The VT1211 internal 3.3V (in5) is scaled by the driver and doesn't 
     2095# need to be adjusted here. VCore doesn't need scaling at all. 
     2096 
     2097    compute in0  @ * (1 + 6.8 / 10),  @ / (1 + 6.8 / 10) 
     2098    compute in1  @ * (1 +   2 / 10),  @ / (1 +   2 / 10) 
     2099    compute in3  @ * (1 +  14 / 10),  @ / (1 +  14 / 10) 
     2100    compute in4  @ * (1 +  47 / 10),  @ / (1 +  47 / 10) 
     2101 
     2102# Adjust this if your vid is wrong (for 2.4 only); see doc/vid 
    21032103#   set vrm 9.1 
    21042104 
    2105 #   set in0_min 2.5 * 0.95 
    2106 #   set in0_max 2.5 * 1.05 
     2105#   set in0_min 3.3 * 0.95 
     2106#   set in0_max 3.3 * 1.05 
    21072107#   set in1_min 2.5 * 0.95 
    21082108#   set in1_max 2.5 * 1.05 
     2109# If your vid is wrong, hardcode the CPU voltage (e.g. 1.4) 
    21092110#   set in2_min vid * 0.97 
    21102111#   set in2_max vid * 1.03 
     
    21132114#   set in4_min 12.0 * 0.90 
    21142115#   set in4_max 12.0 * 1.10 
    2115 #   set in5_min 3.3 * 0.95 
    2116 #   set in5_max 3.3 * 1.05 
    2117  
    2118     compute temp1  (@ - 65) / 0.9686,  (@ * 0.9686) + 65 
    2119     compute temp3  (@ - 65) / 0.9686,  (@ * 0.9686) + 65 
    2120 # 
    2121 # thermistor calculations. 
    2122 # 3435 is the thermistor beta. 
    2123 # '^' is the e**x operator; '`' is the ln(x) operator 
    2124 # (valid in library version 1.4.0 / lm_sensors 2.7.1 or higher) 
    2125 # This assumes that the thermistor forms a resistor divider with a resistor 
    2126 # equal to its nominal value @ 25C. If not, the math gets even harder. 
    2127 # 
    2128     compute temp2  (1 / (((1 / 3435) * (` ((253 - @) / (@ - 43)))) + (1 / 298.15)))  - 273.15, \ 
    2129                    253 - (210 / (1 + (1 / (^ (((3435 * (25 - @)) / ((@ + 273.15) * 298.15))))))) 
    2130     compute temp4  (1 / (((1 / 3435) * (` ((253 - @) / (@ - 43)))) + (1 / 298.15)))  - 273.15, \ 
    2131                    253 - (210 / (1 + (1 / (^ (((3435 * (25 - @)) / ((@ + 273.15) * 298.15))))))) 
    2132     compute temp5  (1 / (((1 / 3435) * (` ((253 - @) / (@ - 43)))) + (1 / 298.15)))  - 273.15, \ 
    2133                    253 - (210 / (1 + (1 / (^ (((3435 * (25 - @)) / ((@ + 273.15) * 298.15))))))) 
    2134     compute temp6  (1 / (((1 / 3435) * (` ((253 - @) / (@ - 43)))) + (1 / 298.15)))  - 273.15, \ 
    2135                    253 - (210 / (1 + (1 / (^ (((3435 * (25 - @)) / ((@ + 273.15) * 298.15))))))) 
    2136     compute temp7  (1 / (((1 / 3435) * (` ((253 - @) / (@ - 43)))) + (1 / 298.15)))  - 273.15, \ 
    2137                    253 - (210 / (1 + (1 / (^ (((3435 * (25 - @)) / ((@ + 273.15) * 298.15))))))) 
    2138  
    2139 #    set temp2_hyst 40 
    2140 #    set temp2_over 45 
     2116    set in5_min 3.3 * 0.95 
     2117    set in5_max 3.3 * 1.05 
     2118 
     2119# The temperature calculations are of the form 
     2120#    compute tempX  (@ - Offset) / Gain, (@ * Gain) + Offset 
     2121# 
     2122# The following are the gain and offset values as recommended by VIA 
     2123#       Diode Type      Gain    Offset 
     2124#       ----------      ----    ------ 
     2125#       Intel CPU       0.9528  88.638 
     2126#                       0.9686  65.000  *) 
     2127#       VIA C3 Ezra     0.9528  83.869 
     2128#       VIA C3 Ezra-T   0.9528  73.869 
     2129# 
     2130# *) These are the values from the previous sensors.conf. I don't know 
     2131# where they came from or how they got derived. 
     2132# 
     2133# The VT1211 internal temperature (temp2) is scaled by the driver 
     2134# and doesn't need to be adjusted here. 
     2135 
     2136    compute temp1  (@ - 73.869) / 0.9528,  (@ * 0.9528) + 73.869 
     2137 
     2138# The thermistor calculations are of the form 
     2139#    compute tempX  1 / (1 / 298.15 - (` Vmax / @ - 1)) / B) - 273.15, \ 
     2140#                   Vmax / (1 + (^ (B / 298.15 - B / (273.15 + @)))) 
     2141# 
     2142# B is the thermistor beta value, Vmax is the reference voltage, '^' is the 
     2143# exp() operator and '`' is the ln() operator. 
     2144# Given B = 3435 and Vmax = 2.2V and assuming that the thermistor forms a 
     2145# resistor divider with a resistor equal to the thermistor's nominal value at 
     2146# 25 degrees C, the following compute lines can be used: 
     2147 
     2148    compute temp3  1 / (1 / 298.15 - (` (2.2 / @ - 1)) / 3435) - 273.15, \ 
     2149                   2.2 / (1 + (^ (3435 / 298.15 - 3435 / (273.15 + @)))) 
     2150    compute temp4  1 / (1 / 298.15 - (` (2.2 / @ - 1)) / 3435) - 273.15, \ 
     2151                   2.2 / (1 + (^ (3435 / 298.15 - 3435 / (273.15 + @)))) 
     2152    compute temp5  1 / (1 / 298.15 - (` (2.2 / @ - 1)) / 3435) - 273.15, \ 
     2153                   2.2 / (1 + (^ (3435 / 298.15 - 3435 / (273.15 + @)))) 
     2154    compute temp6  1 / (1 / 298.15 - (` (2.2 / @ - 1)) / 3435) - 273.15, \ 
     2155                   2.2 / (1 + (^ (3435 / 298.15 - 3435 / (273.15 + @)))) 
     2156    compute temp7  1 / (1 / 298.15 - (` (2.2 / @ - 1)) / 3435) - 273.15, \ 
     2157                   2.2 / (1 + (^ (3435 / 298.15 - 3435 / (273.15 + @)))) 
     2158 
     2159#    set temp1_hyst 80 
     2160#    set temp1_over 85 
     2161#    set temp2_hyst 60 
     2162#    set temp2_over 65 
    21412163#    set temp3_hyst 60 
    21422164#    set temp3_over 65