Back to home page

OSCL-LXR

 
 

    


0001 Kernel driver lm85
0002 ==================
0003 
0004 Supported chips:
0005 
0006   * National Semiconductor LM85 (B and C versions)
0007 
0008     Prefix: 'lm85b' or 'lm85c'
0009 
0010     Addresses scanned: I2C 0x2c, 0x2d, 0x2e
0011 
0012     Datasheet: http://www.national.com/pf/LM/LM85.html
0013 
0014   * Texas Instruments LM96000
0015 
0016     Prefix: 'lm9600'
0017 
0018     Addresses scanned: I2C 0x2c, 0x2d, 0x2e
0019 
0020     Datasheet: https://www.ti.com/lit/ds/symlink/lm96000.pdf
0021 
0022   * Analog Devices ADM1027
0023 
0024     Prefix: 'adm1027'
0025 
0026     Addresses scanned: I2C 0x2c, 0x2d, 0x2e
0027 
0028     Datasheet: https://www.onsemi.com/PowerSolutions/product.do?id=ADM1027
0029 
0030   * Analog Devices ADT7463
0031 
0032     Prefix: 'adt7463'
0033 
0034     Addresses scanned: I2C 0x2c, 0x2d, 0x2e
0035 
0036     Datasheet: https://www.onsemi.com/PowerSolutions/product.do?id=ADT7463
0037 
0038   * Analog Devices ADT7468
0039 
0040     Prefix: 'adt7468'
0041 
0042     Addresses scanned: I2C 0x2c, 0x2d, 0x2e
0043 
0044     Datasheet: https://www.onsemi.com/PowerSolutions/product.do?id=ADT7468
0045 
0046   * SMSC EMC6D100, SMSC EMC6D101
0047 
0048     Prefix: 'emc6d100'
0049 
0050     Addresses scanned: I2C 0x2c, 0x2d, 0x2e
0051 
0052     Datasheet: http://www.smsc.com/media/Downloads_Public/discontinued/6d100.pdf
0053 
0054   * SMSC EMC6D102
0055 
0056     Prefix: 'emc6d102'
0057 
0058     Addresses scanned: I2C 0x2c, 0x2d, 0x2e
0059 
0060     Datasheet: http://www.smsc.com/main/catalog/emc6d102.html
0061 
0062   * SMSC EMC6D103
0063 
0064     Prefix: 'emc6d103'
0065 
0066     Addresses scanned: I2C 0x2c, 0x2d, 0x2e
0067 
0068     Datasheet: http://www.smsc.com/main/catalog/emc6d103.html
0069 
0070   * SMSC EMC6D103S
0071 
0072     Prefix: 'emc6d103s'
0073 
0074     Addresses scanned: I2C 0x2c, 0x2d, 0x2e
0075 
0076     Datasheet: http://www.smsc.com/main/catalog/emc6d103s.html
0077 
0078 Authors:
0079        - Philip Pokorny <ppokorny@penguincomputing.com>,
0080        - Frodo Looijaard <frodol@dds.nl>,
0081        - Richard Barrington <rich_b_nz@clear.net.nz>,
0082        - Margit Schubert-While <margitsw@t-online.de>,
0083        - Justin Thiessen <jthiessen@penguincomputing.com>
0084 
0085 Description
0086 -----------
0087 
0088 This driver implements support for the National Semiconductor LM85 and
0089 compatible chips including the Analog Devices ADM1027, ADT7463, ADT7468 and
0090 SMSC EMC6D10x chips family.
0091 
0092 The LM85 uses the 2-wire interface compatible with the SMBUS 2.0
0093 specification. Using an analog to digital converter it measures three (3)
0094 temperatures and five (5) voltages. It has four (4) 16-bit counters for
0095 measuring fan speed. Five (5) digital inputs are provided for sampling the
0096 VID signals from the processor to the VRM. Lastly, there are three (3) PWM
0097 outputs that can be used to control fan speed.
0098 
0099 The voltage inputs have internal scaling resistors so that the following
0100 voltage can be measured without external resistors:
0101 
0102   2.5V, 3.3V, 5V, 12V, and CPU core voltage (2.25V)
0103 
0104 The temperatures measured are one internal diode, and two remote diodes.
0105 Remote 1 is generally the CPU temperature. These inputs are designed to
0106 measure a thermal diode like the one in a Pentium 4 processor in a socket
0107 423 or socket 478 package. They can also measure temperature using a
0108 transistor like the 2N3904.
0109 
0110 A sophisticated control system for the PWM outputs is designed into the
0111 LM85 that allows fan speed to be adjusted automatically based on any of the
0112 three temperature sensors. Each PWM output is individually adjustable and
0113 programmable. Once configured, the LM85 will adjust the PWM outputs in
0114 response to the measured temperatures without further host intervention.
0115 This feature can also be disabled for manual control of the PWM's.
0116 
0117 Each of the measured inputs (voltage, temperature, fan speed) has
0118 corresponding high/low limit values. The LM85 will signal an ALARM if any
0119 measured value exceeds either limit.
0120 
0121 The LM85 samples all inputs continuously. The lm85 driver will not read
0122 the registers more often than once a second. Further, configuration data is
0123 only read once each 5 minutes. There is twice as much config data as
0124 measurements, so this would seem to be a worthwhile optimization.
0125 
0126 Special Features
0127 ----------------
0128 
0129 The LM85 has four fan speed monitoring modes. The ADM1027 has only two.
0130 Both have special circuitry to compensate for PWM interactions with the
0131 TACH signal from the fans. The ADM1027 can be configured to measure the
0132 speed of a two wire fan, but the input conditioning circuitry is different
0133 for 3-wire and 2-wire mode. For this reason, the 2-wire fan modes are not
0134 exposed to user control. The BIOS should initialize them to the correct
0135 mode. If you've designed your own ADM1027, you'll have to modify the
0136 init_client function and add an insmod parameter to set this up.
0137 
0138 To smooth the response of fans to changes in temperature, the LM85 has an
0139 optional filter for smoothing temperatures. The ADM1027 has the same
0140 config option but uses it to rate limit the changes to fan speed instead.
0141 
0142 The ADM1027, ADT7463 and ADT7468 have a 10-bit ADC and can therefore
0143 measure temperatures with 0.25 degC resolution. They also provide an offset
0144 to the temperature readings that is automatically applied during
0145 measurement. This offset can be used to zero out any errors due to traces
0146 and placement. The documentation says that the offset is in 0.25 degC
0147 steps, but in initial testing of the ADM1027 it was 1.00 degC steps. Analog
0148 Devices has confirmed this "bug". The ADT7463 is reported to work as
0149 described in the documentation. The current lm85 driver does not show the
0150 offset register.
0151 
0152 The ADT7468 has a high-frequency PWM mode, where all PWM outputs are
0153 driven by a 22.5 kHz clock. This is a global mode, not per-PWM output,
0154 which means that setting any PWM frequency above 11.3 kHz will switch
0155 all 3 PWM outputs to a 22.5 kHz frequency. Conversely, setting any PWM
0156 frequency below 11.3 kHz will switch all 3 PWM outputs to a frequency
0157 between 10 and 100 Hz, which can then be tuned separately.
0158 
0159 See the vendor datasheets for more information. There is application note
0160 from National (AN-1260) with some additional information about the LM85.
0161 The Analog Devices datasheet is very detailed and describes a procedure for
0162 determining an optimal configuration for the automatic PWM control.
0163 
0164 The SMSC EMC6D100 & EMC6D101 monitor external voltages, temperatures, and
0165 fan speeds. They use this monitoring capability to alert the system to out
0166 of limit conditions and can automatically control the speeds of multiple
0167 fans in a PC or embedded system. The EMC6D101, available in a 24-pin SSOP
0168 package, and the EMC6D100, available in a 28-pin SSOP package, are designed
0169 to be register compatible. The EMC6D100 offers all the features of the
0170 EMC6D101 plus additional voltage monitoring and system control features.
0171 Unfortunately it is not possible to distinguish between the package
0172 versions on register level so these additional voltage inputs may read
0173 zero. EMC6D102 and EMC6D103 feature additional ADC bits thus extending precision
0174 of voltage and temperature channels.
0175 
0176 SMSC EMC6D103S is similar to EMC6D103, but does not support pwm#_auto_pwm_minctl
0177 and temp#_auto_temp_off.
0178 
0179 The LM96000 supports additional high frequency PWM modes (22.5 kHz, 24 kHz,
0180 25.7 kHz, 27.7 kHz and 30 kHz), which can be configured on a per-PWM basis.
0181 
0182 Hardware Configurations
0183 -----------------------
0184 
0185 The LM85 can be jumpered for 3 different SMBus addresses. There are
0186 no other hardware configuration options for the LM85.
0187 
0188 The lm85 driver detects both LM85B and LM85C revisions of the chip. See the
0189 datasheet for a complete description of the differences. Other than
0190 identifying the chip, the driver behaves no differently with regard to
0191 these two chips. The LM85B is recommended for new designs.
0192 
0193 The ADM1027, ADT7463 and ADT7468 chips have an optional SMBALERT output
0194 that can be used to signal the chipset in case a limit is exceeded or the
0195 temperature sensors fail. Individual sensor interrupts can be masked so
0196 they won't trigger SMBALERT. The SMBALERT output if configured replaces one
0197 of the other functions (PWM2 or IN0). This functionality is not implemented
0198 in current driver.
0199 
0200 The ADT7463 and ADT7468 also have an optional THERM output/input which can
0201 be connected to the processor PROC_HOT output. If available, the autofan
0202 control dynamic Tmin feature can be enabled to keep the system temperature
0203 within spec (just?!) with the least possible fan noise.
0204 
0205 Configuration Notes
0206 -------------------
0207 
0208 Besides standard interfaces driver adds following:
0209 
0210 * Temperatures and Zones
0211 
0212 Each temperature sensor is associated with a Zone. There are three
0213 sensors and therefore three zones (# 1, 2 and 3). Each zone has the following
0214 temperature configuration points:
0215 
0216 * temp#_auto_temp_off
0217         - temperature below which fans should be off or spinning very low.
0218 * temp#_auto_temp_min
0219         - temperature over which fans start to spin.
0220 * temp#_auto_temp_max
0221         - temperature when fans spin at full speed.
0222 * temp#_auto_temp_crit
0223         - temperature when all fans will run full speed.
0224 
0225 PWM Control
0226 ^^^^^^^^^^^
0227 
0228 There are three PWM outputs. The LM85 datasheet suggests that the
0229 pwm3 output control both fan3 and fan4. Each PWM can be individually
0230 configured and assigned to a zone for its control value. Each PWM can be
0231 configured individually according to the following options.
0232 
0233 * pwm#_auto_pwm_min
0234         - this specifies the PWM value for temp#_auto_temp_off
0235           temperature. (PWM value from 0 to 255)
0236 
0237 * pwm#_auto_pwm_minctl
0238         - this flags selects for temp#_auto_temp_off temperature
0239           the behaviour of fans. Write 1 to let fans spinning at
0240           pwm#_auto_pwm_min or write 0 to let them off.
0241 
0242 .. note::
0243 
0244         It has been reported that there is a bug in the LM85 that causes
0245         the flag to be associated with the zones not the PWMs. This
0246         contradicts all the published documentation. Setting pwm#_min_ctl
0247         in this case actually affects all PWMs controlled by zone '#'.
0248 
0249 PWM Controlling Zone selection
0250 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0251 
0252 * pwm#_auto_channels
0253         - controls zone that is associated with PWM
0254 
0255 Configuration choices:
0256 
0257 ========== =============================================
0258 Value      Meaning
0259 ========== =============================================
0260       1    Controlled by Zone 1
0261       2    Controlled by Zone 2
0262       3    Controlled by Zone 3
0263      23    Controlled by higher temp of Zone 2 or 3
0264     123    Controlled by highest temp of Zone 1, 2 or 3
0265       0    PWM always 0%  (off)
0266      -1    PWM always 100%  (full on)
0267      -2    Manual control (write to 'pwm#' to set)
0268 ========== =============================================
0269 
0270 The National LM85's have two vendor specific configuration
0271 features. Tach. mode and Spinup Control. For more details on these,
0272 see the LM85 datasheet or Application Note AN-1260. These features
0273 are not currently supported by the lm85 driver.
0274 
0275 The Analog Devices ADM1027 has several vendor specific enhancements.
0276 The number of pulses-per-rev of the fans can be set, Tach monitoring
0277 can be optimized for PWM operation, and an offset can be applied to
0278 the temperatures to compensate for systemic errors in the
0279 measurements. These features are not currently supported by the lm85
0280 driver.
0281 
0282 In addition to the ADM1027 features, the ADT7463 and ADT7468 also have
0283 Tmin control and THERM asserted counts. Automatic Tmin control acts to
0284 adjust the Tmin value to maintain the measured temperature sensor at a
0285 specified temperature. There isn't much documentation on this feature in
0286 the ADT7463 data sheet. This is not supported by current driver.