R.Marek@sh.cvut.cz | 7f15b66 | 2005-05-26 12:42:19 +0000 | [diff] [blame] | 1 | Kernel driver lm85 |
| 2 | ================== |
| 3 | |
| 4 | Supported chips: |
| 5 | * National Semiconductor LM85 (B and C versions) |
| 6 | Prefix: 'lm85' |
| 7 | Addresses scanned: I2C 0x2c, 0x2d, 0x2e |
| 8 | Datasheet: http://www.national.com/pf/LM/LM85.html |
| 9 | * Analog Devices ADM1027 |
| 10 | Prefix: 'adm1027' |
| 11 | Addresses scanned: I2C 0x2c, 0x2d, 0x2e |
Justin P. Mattock | 0ea6e61 | 2010-07-23 20:51:24 -0700 | [diff] [blame] | 12 | Datasheet: http://www.onsemi.com/PowerSolutions/product.do?id=ADM1027 |
R.Marek@sh.cvut.cz | 7f15b66 | 2005-05-26 12:42:19 +0000 | [diff] [blame] | 13 | * Analog Devices ADT7463 |
| 14 | Prefix: 'adt7463' |
| 15 | Addresses scanned: I2C 0x2c, 0x2d, 0x2e |
Justin P. Mattock | 0ea6e61 | 2010-07-23 20:51:24 -0700 | [diff] [blame] | 16 | Datasheet: http://www.onsemi.com/PowerSolutions/product.do?id=ADT7463 |
Jean Delvare | c36364d | 2010-10-28 20:31:50 +0200 | [diff] [blame] | 17 | * Analog Devices ADT7468 |
| 18 | Prefix: 'adt7468' |
| 19 | Addresses scanned: I2C 0x2c, 0x2d, 0x2e |
| 20 | Datasheet: http://www.onsemi.com/PowerSolutions/product.do?id=ADT7468 |
R.Marek@sh.cvut.cz | 7f15b66 | 2005-05-26 12:42:19 +0000 | [diff] [blame] | 21 | * SMSC EMC6D100, SMSC EMC6D101 |
| 22 | Prefix: 'emc6d100' |
| 23 | Addresses scanned: I2C 0x2c, 0x2d, 0x2e |
Justin P. Mattock | 0ea6e61 | 2010-07-23 20:51:24 -0700 | [diff] [blame] | 24 | Datasheet: http://www.smsc.com/media/Downloads_Public/discontinued/6d100.pdf |
R.Marek@sh.cvut.cz | 7f15b66 | 2005-05-26 12:42:19 +0000 | [diff] [blame] | 25 | * SMSC EMC6D102 |
| 26 | Prefix: 'emc6d102' |
| 27 | Addresses scanned: I2C 0x2c, 0x2d, 0x2e |
| 28 | Datasheet: http://www.smsc.com/main/catalog/emc6d102.html |
| 29 | |
| 30 | Authors: |
| 31 | Philip Pokorny <ppokorny@penguincomputing.com>, |
| 32 | Frodo Looijaard <frodol@dds.nl>, |
| 33 | Richard Barrington <rich_b_nz@clear.net.nz>, |
| 34 | Margit Schubert-While <margitsw@t-online.de>, |
| 35 | Justin Thiessen <jthiessen@penguincomputing.com> |
| 36 | |
| 37 | Description |
| 38 | ----------- |
| 39 | |
| 40 | This driver implements support for the National Semiconductor LM85 and |
Jean Delvare | c36364d | 2010-10-28 20:31:50 +0200 | [diff] [blame] | 41 | compatible chips including the Analog Devices ADM1027, ADT7463, ADT7468 and |
R.Marek@sh.cvut.cz | 7f15b66 | 2005-05-26 12:42:19 +0000 | [diff] [blame] | 42 | SMSC EMC6D10x chips family. |
| 43 | |
| 44 | The LM85 uses the 2-wire interface compatible with the SMBUS 2.0 |
| 45 | specification. Using an analog to digital converter it measures three (3) |
| 46 | temperatures and five (5) voltages. It has four (4) 16-bit counters for |
| 47 | measuring fan speed. Five (5) digital inputs are provided for sampling the |
| 48 | VID signals from the processor to the VRM. Lastly, there are three (3) PWM |
| 49 | outputs that can be used to control fan speed. |
| 50 | |
| 51 | The voltage inputs have internal scaling resistors so that the following |
| 52 | voltage can be measured without external resistors: |
| 53 | |
| 54 | 2.5V, 3.3V, 5V, 12V, and CPU core voltage (2.25V) |
| 55 | |
| 56 | The temperatures measured are one internal diode, and two remote diodes. |
| 57 | Remote 1 is generally the CPU temperature. These inputs are designed to |
| 58 | measure a thermal diode like the one in a Pentium 4 processor in a socket |
| 59 | 423 or socket 478 package. They can also measure temperature using a |
| 60 | transistor like the 2N3904. |
| 61 | |
| 62 | A sophisticated control system for the PWM outputs is designed into the |
| 63 | LM85 that allows fan speed to be adjusted automatically based on any of the |
| 64 | three temperature sensors. Each PWM output is individually adjustable and |
| 65 | programmable. Once configured, the LM85 will adjust the PWM outputs in |
| 66 | response to the measured temperatures without further host intervention. |
| 67 | This feature can also be disabled for manual control of the PWM's. |
| 68 | |
| 69 | Each of the measured inputs (voltage, temperature, fan speed) has |
| 70 | corresponding high/low limit values. The LM85 will signal an ALARM if any |
| 71 | measured value exceeds either limit. |
| 72 | |
| 73 | The LM85 samples all inputs continuously. The lm85 driver will not read |
| 74 | the registers more often than once a second. Further, configuration data is |
| 75 | only read once each 5 minutes. There is twice as much config data as |
| 76 | measurements, so this would seem to be a worthwhile optimization. |
| 77 | |
| 78 | Special Features |
| 79 | ---------------- |
| 80 | |
| 81 | The LM85 has four fan speed monitoring modes. The ADM1027 has only two. |
| 82 | Both have special circuitry to compensate for PWM interactions with the |
| 83 | TACH signal from the fans. The ADM1027 can be configured to measure the |
| 84 | speed of a two wire fan, but the input conditioning circuitry is different |
| 85 | for 3-wire and 2-wire mode. For this reason, the 2-wire fan modes are not |
| 86 | exposed to user control. The BIOS should initialize them to the correct |
| 87 | mode. If you've designed your own ADM1027, you'll have to modify the |
| 88 | init_client function and add an insmod parameter to set this up. |
| 89 | |
| 90 | To smooth the response of fans to changes in temperature, the LM85 has an |
| 91 | optional filter for smoothing temperatures. The ADM1027 has the same |
| 92 | config option but uses it to rate limit the changes to fan speed instead. |
| 93 | |
Jean Delvare | c36364d | 2010-10-28 20:31:50 +0200 | [diff] [blame] | 94 | The ADM1027, ADT7463 and ADT7468 have a 10-bit ADC and can therefore |
| 95 | measure temperatures with 0.25 degC resolution. They also provide an offset |
| 96 | to the temperature readings that is automatically applied during |
| 97 | measurement. This offset can be used to zero out any errors due to traces |
| 98 | and placement. The documentation says that the offset is in 0.25 degC |
| 99 | steps, but in initial testing of the ADM1027 it was 1.00 degC steps. Analog |
| 100 | Devices has confirmed this "bug". The ADT7463 is reported to work as |
| 101 | described in the documentation. The current lm85 driver does not show the |
| 102 | offset register. |
R.Marek@sh.cvut.cz | 7f15b66 | 2005-05-26 12:42:19 +0000 | [diff] [blame] | 103 | |
Jean Delvare | f6c61cf | 2010-10-28 20:31:50 +0200 | [diff] [blame] | 104 | The ADT7468 has a high-frequency PWM mode, where all PWM outputs are |
| 105 | driven by a 22.5 kHz clock. This is a global mode, not per-PWM output, |
| 106 | which means that setting any PWM frequency above 11.3 kHz will switch |
| 107 | all 3 PWM outputs to a 22.5 kHz frequency. Conversely, setting any PWM |
| 108 | frequency below 11.3 kHz will switch all 3 PWM outputs to a frequency |
| 109 | between 10 and 100 Hz, which can then be tuned separately. |
| 110 | |
R.Marek@sh.cvut.cz | 7f15b66 | 2005-05-26 12:42:19 +0000 | [diff] [blame] | 111 | See the vendor datasheets for more information. There is application note |
| 112 | from National (AN-1260) with some additional information about the LM85. |
| 113 | The Analog Devices datasheet is very detailed and describes a procedure for |
| 114 | determining an optimal configuration for the automatic PWM control. |
| 115 | |
| 116 | The SMSC EMC6D100 & EMC6D101 monitor external voltages, temperatures, and |
| 117 | fan speeds. They use this monitoring capability to alert the system to out |
| 118 | of limit conditions and can automatically control the speeds of multiple |
| 119 | fans in a PC or embedded system. The EMC6D101, available in a 24-pin SSOP |
| 120 | package, and the EMC6D100, available in a 28-pin SSOP package, are designed |
| 121 | to be register compatible. The EMC6D100 offers all the features of the |
| 122 | EMC6D101 plus additional voltage monitoring and system control features. |
| 123 | Unfortunately it is not possible to distinguish between the package |
| 124 | versions on register level so these additional voltage inputs may read |
| 125 | zero. The EMC6D102 features addtional ADC bits thus extending precision |
| 126 | of voltage and temperature channels. |
| 127 | |
| 128 | |
| 129 | Hardware Configurations |
| 130 | ----------------------- |
| 131 | |
| 132 | The LM85 can be jumpered for 3 different SMBus addresses. There are |
| 133 | no other hardware configuration options for the LM85. |
| 134 | |
| 135 | The lm85 driver detects both LM85B and LM85C revisions of the chip. See the |
| 136 | datasheet for a complete description of the differences. Other than |
| 137 | identifying the chip, the driver behaves no differently with regard to |
| 138 | these two chips. The LM85B is recommended for new designs. |
| 139 | |
Jean Delvare | c36364d | 2010-10-28 20:31:50 +0200 | [diff] [blame] | 140 | The ADM1027, ADT7463 and ADT7468 chips have an optional SMBALERT output |
| 141 | that can be used to signal the chipset in case a limit is exceeded or the |
| 142 | temperature sensors fail. Individual sensor interrupts can be masked so |
| 143 | they won't trigger SMBALERT. The SMBALERT output if configured replaces one |
| 144 | of the other functions (PWM2 or IN0). This functionality is not implemented |
| 145 | in current driver. |
R.Marek@sh.cvut.cz | 7f15b66 | 2005-05-26 12:42:19 +0000 | [diff] [blame] | 146 | |
Jean Delvare | c36364d | 2010-10-28 20:31:50 +0200 | [diff] [blame] | 147 | The ADT7463 and ADT7468 also have an optional THERM output/input which can |
| 148 | be connected to the processor PROC_HOT output. If available, the autofan |
| 149 | control dynamic Tmin feature can be enabled to keep the system temperature |
| 150 | within spec (just?!) with the least possible fan noise. |
R.Marek@sh.cvut.cz | 7f15b66 | 2005-05-26 12:42:19 +0000 | [diff] [blame] | 151 | |
| 152 | Configuration Notes |
| 153 | ------------------- |
| 154 | |
| 155 | Besides standard interfaces driver adds following: |
| 156 | |
| 157 | * Temperatures and Zones |
| 158 | |
| 159 | Each temperature sensor is associated with a Zone. There are three |
| 160 | sensors and therefore three zones (# 1, 2 and 3). Each zone has the following |
| 161 | temperature configuration points: |
| 162 | |
| 163 | * temp#_auto_temp_off - temperature below which fans should be off or spinning very low. |
| 164 | * temp#_auto_temp_min - temperature over which fans start to spin. |
| 165 | * temp#_auto_temp_max - temperature when fans spin at full speed. |
| 166 | * temp#_auto_temp_crit - temperature when all fans will run full speed. |
| 167 | |
| 168 | * PWM Control |
| 169 | |
| 170 | There are three PWM outputs. The LM85 datasheet suggests that the |
| 171 | pwm3 output control both fan3 and fan4. Each PWM can be individually |
Francis Galiegue | a33f322 | 2010-04-23 00:08:02 +0200 | [diff] [blame] | 172 | configured and assigned to a zone for its control value. Each PWM can be |
R.Marek@sh.cvut.cz | 7f15b66 | 2005-05-26 12:42:19 +0000 | [diff] [blame] | 173 | configured individually according to the following options. |
| 174 | |
| 175 | * pwm#_auto_pwm_min - this specifies the PWM value for temp#_auto_temp_off |
| 176 | temperature. (PWM value from 0 to 255) |
| 177 | |
R.Marek@sh.cvut.cz | 7f15b66 | 2005-05-26 12:42:19 +0000 | [diff] [blame] | 178 | * pwm#_auto_pwm_minctl - this flags selects for temp#_auto_temp_off temperature |
Jean Delvare | 77fa49d | 2009-01-07 16:37:35 +0100 | [diff] [blame] | 179 | the behaviour of fans. Write 1 to let fans spinning at |
R.Marek@sh.cvut.cz | 7f15b66 | 2005-05-26 12:42:19 +0000 | [diff] [blame] | 180 | pwm#_auto_pwm_min or write 0 to let them off. |
| 181 | |
| 182 | NOTE: It has been reported that there is a bug in the LM85 that causes the flag |
| 183 | to be associated with the zones not the PWMs. This contradicts all the |
| 184 | published documentation. Setting pwm#_min_ctl in this case actually affects all |
| 185 | PWMs controlled by zone '#'. |
| 186 | |
| 187 | * PWM Controlling Zone selection |
| 188 | |
| 189 | * pwm#_auto_channels - controls zone that is associated with PWM |
| 190 | |
| 191 | Configuration choices: |
| 192 | |
| 193 | Value Meaning |
| 194 | ------ ------------------------------------------------ |
| 195 | 1 Controlled by Zone 1 |
| 196 | 2 Controlled by Zone 2 |
| 197 | 3 Controlled by Zone 3 |
| 198 | 23 Controlled by higher temp of Zone 2 or 3 |
| 199 | 123 Controlled by highest temp of Zone 1, 2 or 3 |
| 200 | 0 PWM always 0% (off) |
| 201 | -1 PWM always 100% (full on) |
| 202 | -2 Manual control (write to 'pwm#' to set) |
| 203 | |
| 204 | The National LM85's have two vendor specific configuration |
| 205 | features. Tach. mode and Spinup Control. For more details on these, |
Jean Delvare | dd1ac53 | 2008-05-01 08:47:33 +0200 | [diff] [blame] | 206 | see the LM85 datasheet or Application Note AN-1260. These features |
| 207 | are not currently supported by the lm85 driver. |
R.Marek@sh.cvut.cz | 7f15b66 | 2005-05-26 12:42:19 +0000 | [diff] [blame] | 208 | |
| 209 | The Analog Devices ADM1027 has several vendor specific enhancements. |
| 210 | The number of pulses-per-rev of the fans can be set, Tach monitoring |
| 211 | can be optimized for PWM operation, and an offset can be applied to |
| 212 | the temperatures to compensate for systemic errors in the |
Jean Delvare | dd1ac53 | 2008-05-01 08:47:33 +0200 | [diff] [blame] | 213 | measurements. These features are not currently supported by the lm85 |
| 214 | driver. |
R.Marek@sh.cvut.cz | 7f15b66 | 2005-05-26 12:42:19 +0000 | [diff] [blame] | 215 | |
Jean Delvare | c36364d | 2010-10-28 20:31:50 +0200 | [diff] [blame] | 216 | In addition to the ADM1027 features, the ADT7463 and ADT7468 also have |
| 217 | Tmin control and THERM asserted counts. Automatic Tmin control acts to |
| 218 | adjust the Tmin value to maintain the measured temperature sensor at a |
| 219 | specified temperature. There isn't much documentation on this feature in |
| 220 | the ADT7463 data sheet. This is not supported by current driver. |