17f15b664SR.Marek@sh.cvut.czKernel driver lm85 27f15b664SR.Marek@sh.cvut.cz================== 37f15b664SR.Marek@sh.cvut.cz 47f15b664SR.Marek@sh.cvut.czSupported chips: 5b04f2f7dSMauro Carvalho Chehab 67f15b664SR.Marek@sh.cvut.cz * National Semiconductor LM85 (B and C versions) 7b04f2f7dSMauro Carvalho Chehab 811650cf0SJeremy Gebben Prefix: 'lm85b' or 'lm85c' 9b04f2f7dSMauro Carvalho Chehab 107f15b664SR.Marek@sh.cvut.cz Addresses scanned: I2C 0x2c, 0x2d, 0x2e 11b04f2f7dSMauro Carvalho Chehab 127f15b664SR.Marek@sh.cvut.cz Datasheet: http://www.national.com/pf/LM/LM85.html 13b04f2f7dSMauro Carvalho Chehab 1411650cf0SJeremy Gebben * Texas Instruments LM96000 15b04f2f7dSMauro Carvalho Chehab 1611650cf0SJeremy Gebben Prefix: 'lm9600' 17b04f2f7dSMauro Carvalho Chehab 1811650cf0SJeremy Gebben Addresses scanned: I2C 0x2c, 0x2d, 0x2e 19b04f2f7dSMauro Carvalho Chehab 20*ad736c1aSAlexander A. Klimov Datasheet: https://www.ti.com/lit/ds/symlink/lm96000.pdf 21b04f2f7dSMauro Carvalho Chehab 227f15b664SR.Marek@sh.cvut.cz * Analog Devices ADM1027 23b04f2f7dSMauro Carvalho Chehab 247f15b664SR.Marek@sh.cvut.cz Prefix: 'adm1027' 25b04f2f7dSMauro Carvalho Chehab 267f15b664SR.Marek@sh.cvut.cz Addresses scanned: I2C 0x2c, 0x2d, 0x2e 27b04f2f7dSMauro Carvalho Chehab 28*ad736c1aSAlexander A. Klimov Datasheet: https://www.onsemi.com/PowerSolutions/product.do?id=ADM1027 29b04f2f7dSMauro Carvalho Chehab 307f15b664SR.Marek@sh.cvut.cz * Analog Devices ADT7463 31b04f2f7dSMauro Carvalho Chehab 327f15b664SR.Marek@sh.cvut.cz Prefix: 'adt7463' 33b04f2f7dSMauro Carvalho Chehab 347f15b664SR.Marek@sh.cvut.cz Addresses scanned: I2C 0x2c, 0x2d, 0x2e 35b04f2f7dSMauro Carvalho Chehab 36*ad736c1aSAlexander A. Klimov Datasheet: https://www.onsemi.com/PowerSolutions/product.do?id=ADT7463 37b04f2f7dSMauro Carvalho Chehab 38c36364dbSJean Delvare * Analog Devices ADT7468 39b04f2f7dSMauro Carvalho Chehab 40c36364dbSJean Delvare Prefix: 'adt7468' 41b04f2f7dSMauro Carvalho Chehab 42c36364dbSJean Delvare Addresses scanned: I2C 0x2c, 0x2d, 0x2e 43b04f2f7dSMauro Carvalho Chehab 44*ad736c1aSAlexander A. Klimov Datasheet: https://www.onsemi.com/PowerSolutions/product.do?id=ADT7468 45b04f2f7dSMauro Carvalho Chehab 467f15b664SR.Marek@sh.cvut.cz * SMSC EMC6D100, SMSC EMC6D101 47b04f2f7dSMauro Carvalho Chehab 487f15b664SR.Marek@sh.cvut.cz Prefix: 'emc6d100' 49b04f2f7dSMauro Carvalho Chehab 507f15b664SR.Marek@sh.cvut.cz Addresses scanned: I2C 0x2c, 0x2d, 0x2e 51b04f2f7dSMauro Carvalho Chehab 520ea6e611SJustin P. Mattock Datasheet: http://www.smsc.com/media/Downloads_Public/discontinued/6d100.pdf 53b04f2f7dSMauro Carvalho Chehab 547f15b664SR.Marek@sh.cvut.cz * SMSC EMC6D102 55b04f2f7dSMauro Carvalho Chehab 567f15b664SR.Marek@sh.cvut.cz Prefix: 'emc6d102' 57b04f2f7dSMauro Carvalho Chehab 587f15b664SR.Marek@sh.cvut.cz Addresses scanned: I2C 0x2c, 0x2d, 0x2e 59b04f2f7dSMauro Carvalho Chehab 607f15b664SR.Marek@sh.cvut.cz Datasheet: http://www.smsc.com/main/catalog/emc6d102.html 61b04f2f7dSMauro Carvalho Chehab 6206923f84SGuenter Roeck * SMSC EMC6D103 63b04f2f7dSMauro Carvalho Chehab 6406923f84SGuenter Roeck Prefix: 'emc6d103' 65b04f2f7dSMauro Carvalho Chehab 6606923f84SGuenter Roeck Addresses scanned: I2C 0x2c, 0x2d, 0x2e 67b04f2f7dSMauro Carvalho Chehab 6806923f84SGuenter Roeck Datasheet: http://www.smsc.com/main/catalog/emc6d103.html 69b04f2f7dSMauro Carvalho Chehab 7006923f84SGuenter Roeck * SMSC EMC6D103S 71b04f2f7dSMauro Carvalho Chehab 7206923f84SGuenter Roeck Prefix: 'emc6d103s' 73b04f2f7dSMauro Carvalho Chehab 7406923f84SGuenter Roeck Addresses scanned: I2C 0x2c, 0x2d, 0x2e 75b04f2f7dSMauro Carvalho Chehab 7606923f84SGuenter Roeck Datasheet: http://www.smsc.com/main/catalog/emc6d103s.html 777f15b664SR.Marek@sh.cvut.cz 787f15b664SR.Marek@sh.cvut.czAuthors: 79b04f2f7dSMauro Carvalho Chehab - Philip Pokorny <ppokorny@penguincomputing.com>, 80b04f2f7dSMauro Carvalho Chehab - Frodo Looijaard <frodol@dds.nl>, 81b04f2f7dSMauro Carvalho Chehab - Richard Barrington <rich_b_nz@clear.net.nz>, 82b04f2f7dSMauro Carvalho Chehab - Margit Schubert-While <margitsw@t-online.de>, 83b04f2f7dSMauro Carvalho Chehab - Justin Thiessen <jthiessen@penguincomputing.com> 847f15b664SR.Marek@sh.cvut.cz 857f15b664SR.Marek@sh.cvut.czDescription 867f15b664SR.Marek@sh.cvut.cz----------- 877f15b664SR.Marek@sh.cvut.cz 887f15b664SR.Marek@sh.cvut.czThis driver implements support for the National Semiconductor LM85 and 89c36364dbSJean Delvarecompatible chips including the Analog Devices ADM1027, ADT7463, ADT7468 and 907f15b664SR.Marek@sh.cvut.czSMSC EMC6D10x chips family. 917f15b664SR.Marek@sh.cvut.cz 927f15b664SR.Marek@sh.cvut.czThe LM85 uses the 2-wire interface compatible with the SMBUS 2.0 937f15b664SR.Marek@sh.cvut.czspecification. Using an analog to digital converter it measures three (3) 947f15b664SR.Marek@sh.cvut.cztemperatures and five (5) voltages. It has four (4) 16-bit counters for 957f15b664SR.Marek@sh.cvut.czmeasuring fan speed. Five (5) digital inputs are provided for sampling the 967f15b664SR.Marek@sh.cvut.czVID signals from the processor to the VRM. Lastly, there are three (3) PWM 977f15b664SR.Marek@sh.cvut.czoutputs that can be used to control fan speed. 987f15b664SR.Marek@sh.cvut.cz 997f15b664SR.Marek@sh.cvut.czThe voltage inputs have internal scaling resistors so that the following 1007f15b664SR.Marek@sh.cvut.czvoltage can be measured without external resistors: 1017f15b664SR.Marek@sh.cvut.cz 1027f15b664SR.Marek@sh.cvut.cz 2.5V, 3.3V, 5V, 12V, and CPU core voltage (2.25V) 1037f15b664SR.Marek@sh.cvut.cz 1047f15b664SR.Marek@sh.cvut.czThe temperatures measured are one internal diode, and two remote diodes. 1057f15b664SR.Marek@sh.cvut.czRemote 1 is generally the CPU temperature. These inputs are designed to 1067f15b664SR.Marek@sh.cvut.czmeasure a thermal diode like the one in a Pentium 4 processor in a socket 1077f15b664SR.Marek@sh.cvut.cz423 or socket 478 package. They can also measure temperature using a 1087f15b664SR.Marek@sh.cvut.cztransistor like the 2N3904. 1097f15b664SR.Marek@sh.cvut.cz 1107f15b664SR.Marek@sh.cvut.czA sophisticated control system for the PWM outputs is designed into the 1117f15b664SR.Marek@sh.cvut.czLM85 that allows fan speed to be adjusted automatically based on any of the 1127f15b664SR.Marek@sh.cvut.czthree temperature sensors. Each PWM output is individually adjustable and 1137f15b664SR.Marek@sh.cvut.czprogrammable. Once configured, the LM85 will adjust the PWM outputs in 1147f15b664SR.Marek@sh.cvut.czresponse to the measured temperatures without further host intervention. 1157f15b664SR.Marek@sh.cvut.czThis feature can also be disabled for manual control of the PWM's. 1167f15b664SR.Marek@sh.cvut.cz 1177f15b664SR.Marek@sh.cvut.czEach of the measured inputs (voltage, temperature, fan speed) has 1187f15b664SR.Marek@sh.cvut.czcorresponding high/low limit values. The LM85 will signal an ALARM if any 1197f15b664SR.Marek@sh.cvut.czmeasured value exceeds either limit. 1207f15b664SR.Marek@sh.cvut.cz 1217f15b664SR.Marek@sh.cvut.czThe LM85 samples all inputs continuously. The lm85 driver will not read 1227f15b664SR.Marek@sh.cvut.czthe registers more often than once a second. Further, configuration data is 1237f15b664SR.Marek@sh.cvut.czonly read once each 5 minutes. There is twice as much config data as 1247f15b664SR.Marek@sh.cvut.czmeasurements, so this would seem to be a worthwhile optimization. 1257f15b664SR.Marek@sh.cvut.cz 1267f15b664SR.Marek@sh.cvut.czSpecial Features 1277f15b664SR.Marek@sh.cvut.cz---------------- 1287f15b664SR.Marek@sh.cvut.cz 1297f15b664SR.Marek@sh.cvut.czThe LM85 has four fan speed monitoring modes. The ADM1027 has only two. 1307f15b664SR.Marek@sh.cvut.czBoth have special circuitry to compensate for PWM interactions with the 1317f15b664SR.Marek@sh.cvut.czTACH signal from the fans. The ADM1027 can be configured to measure the 1327f15b664SR.Marek@sh.cvut.czspeed of a two wire fan, but the input conditioning circuitry is different 1337f15b664SR.Marek@sh.cvut.czfor 3-wire and 2-wire mode. For this reason, the 2-wire fan modes are not 1347f15b664SR.Marek@sh.cvut.czexposed to user control. The BIOS should initialize them to the correct 1357f15b664SR.Marek@sh.cvut.czmode. If you've designed your own ADM1027, you'll have to modify the 1367f15b664SR.Marek@sh.cvut.czinit_client function and add an insmod parameter to set this up. 1377f15b664SR.Marek@sh.cvut.cz 1387f15b664SR.Marek@sh.cvut.czTo smooth the response of fans to changes in temperature, the LM85 has an 1397f15b664SR.Marek@sh.cvut.czoptional filter for smoothing temperatures. The ADM1027 has the same 1407f15b664SR.Marek@sh.cvut.czconfig option but uses it to rate limit the changes to fan speed instead. 1417f15b664SR.Marek@sh.cvut.cz 142c36364dbSJean DelvareThe ADM1027, ADT7463 and ADT7468 have a 10-bit ADC and can therefore 143c36364dbSJean Delvaremeasure temperatures with 0.25 degC resolution. They also provide an offset 144c36364dbSJean Delvareto the temperature readings that is automatically applied during 145c36364dbSJean Delvaremeasurement. This offset can be used to zero out any errors due to traces 146c36364dbSJean Delvareand placement. The documentation says that the offset is in 0.25 degC 147c36364dbSJean Delvaresteps, but in initial testing of the ADM1027 it was 1.00 degC steps. Analog 148c36364dbSJean DelvareDevices has confirmed this "bug". The ADT7463 is reported to work as 149c36364dbSJean Delvaredescribed in the documentation. The current lm85 driver does not show the 150c36364dbSJean Delvareoffset register. 1517f15b664SR.Marek@sh.cvut.cz 152f6c61cffSJean DelvareThe ADT7468 has a high-frequency PWM mode, where all PWM outputs are 153f6c61cffSJean Delvaredriven by a 22.5 kHz clock. This is a global mode, not per-PWM output, 154f6c61cffSJean Delvarewhich means that setting any PWM frequency above 11.3 kHz will switch 155f6c61cffSJean Delvareall 3 PWM outputs to a 22.5 kHz frequency. Conversely, setting any PWM 156f6c61cffSJean Delvarefrequency below 11.3 kHz will switch all 3 PWM outputs to a frequency 157f6c61cffSJean Delvarebetween 10 and 100 Hz, which can then be tuned separately. 158f6c61cffSJean Delvare 1597f15b664SR.Marek@sh.cvut.czSee the vendor datasheets for more information. There is application note 1607f15b664SR.Marek@sh.cvut.czfrom National (AN-1260) with some additional information about the LM85. 1617f15b664SR.Marek@sh.cvut.czThe Analog Devices datasheet is very detailed and describes a procedure for 1627f15b664SR.Marek@sh.cvut.czdetermining an optimal configuration for the automatic PWM control. 1637f15b664SR.Marek@sh.cvut.cz 1647f15b664SR.Marek@sh.cvut.czThe SMSC EMC6D100 & EMC6D101 monitor external voltages, temperatures, and 1657f15b664SR.Marek@sh.cvut.czfan speeds. They use this monitoring capability to alert the system to out 1667f15b664SR.Marek@sh.cvut.czof limit conditions and can automatically control the speeds of multiple 1677f15b664SR.Marek@sh.cvut.czfans in a PC or embedded system. The EMC6D101, available in a 24-pin SSOP 1687f15b664SR.Marek@sh.cvut.czpackage, and the EMC6D100, available in a 28-pin SSOP package, are designed 1697f15b664SR.Marek@sh.cvut.czto be register compatible. The EMC6D100 offers all the features of the 1707f15b664SR.Marek@sh.cvut.czEMC6D101 plus additional voltage monitoring and system control features. 1717f15b664SR.Marek@sh.cvut.czUnfortunately it is not possible to distinguish between the package 1727f15b664SR.Marek@sh.cvut.czversions on register level so these additional voltage inputs may read 17306923f84SGuenter Roeckzero. EMC6D102 and EMC6D103 feature additional ADC bits thus extending precision 1747f15b664SR.Marek@sh.cvut.czof voltage and temperature channels. 1757f15b664SR.Marek@sh.cvut.cz 17606923f84SGuenter RoeckSMSC EMC6D103S is similar to EMC6D103, but does not support pwm#_auto_pwm_minctl 17706923f84SGuenter Roeckand temp#_auto_temp_off. 1787f15b664SR.Marek@sh.cvut.cz 179e9b95485SJeremy GebbenThe LM96000 supports additional high frequency PWM modes (22.5 kHz, 24 kHz, 180e9b95485SJeremy Gebben25.7 kHz, 27.7 kHz and 30 kHz), which can be configured on a per-PWM basis. 181e9b95485SJeremy Gebben 1827f15b664SR.Marek@sh.cvut.czHardware Configurations 1837f15b664SR.Marek@sh.cvut.cz----------------------- 1847f15b664SR.Marek@sh.cvut.cz 1857f15b664SR.Marek@sh.cvut.czThe LM85 can be jumpered for 3 different SMBus addresses. There are 1867f15b664SR.Marek@sh.cvut.czno other hardware configuration options for the LM85. 1877f15b664SR.Marek@sh.cvut.cz 1887f15b664SR.Marek@sh.cvut.czThe lm85 driver detects both LM85B and LM85C revisions of the chip. See the 1897f15b664SR.Marek@sh.cvut.czdatasheet for a complete description of the differences. Other than 1907f15b664SR.Marek@sh.cvut.czidentifying the chip, the driver behaves no differently with regard to 1917f15b664SR.Marek@sh.cvut.czthese two chips. The LM85B is recommended for new designs. 1927f15b664SR.Marek@sh.cvut.cz 193c36364dbSJean DelvareThe ADM1027, ADT7463 and ADT7468 chips have an optional SMBALERT output 194c36364dbSJean Delvarethat can be used to signal the chipset in case a limit is exceeded or the 195c36364dbSJean Delvaretemperature sensors fail. Individual sensor interrupts can be masked so 196c36364dbSJean Delvarethey won't trigger SMBALERT. The SMBALERT output if configured replaces one 197c36364dbSJean Delvareof the other functions (PWM2 or IN0). This functionality is not implemented 198c36364dbSJean Delvarein current driver. 1997f15b664SR.Marek@sh.cvut.cz 200c36364dbSJean DelvareThe ADT7463 and ADT7468 also have an optional THERM output/input which can 201c36364dbSJean Delvarebe connected to the processor PROC_HOT output. If available, the autofan 202c36364dbSJean Delvarecontrol dynamic Tmin feature can be enabled to keep the system temperature 203c36364dbSJean Delvarewithin spec (just?!) with the least possible fan noise. 2047f15b664SR.Marek@sh.cvut.cz 2057f15b664SR.Marek@sh.cvut.czConfiguration Notes 2067f15b664SR.Marek@sh.cvut.cz------------------- 2077f15b664SR.Marek@sh.cvut.cz 2087f15b664SR.Marek@sh.cvut.czBesides standard interfaces driver adds following: 2097f15b664SR.Marek@sh.cvut.cz 2107f15b664SR.Marek@sh.cvut.cz* Temperatures and Zones 2117f15b664SR.Marek@sh.cvut.cz 2127f15b664SR.Marek@sh.cvut.czEach temperature sensor is associated with a Zone. There are three 2137f15b664SR.Marek@sh.cvut.czsensors and therefore three zones (# 1, 2 and 3). Each zone has the following 2147f15b664SR.Marek@sh.cvut.cztemperature configuration points: 2157f15b664SR.Marek@sh.cvut.cz 216b04f2f7dSMauro Carvalho Chehab* temp#_auto_temp_off 217b04f2f7dSMauro Carvalho Chehab - temperature below which fans should be off or spinning very low. 218b04f2f7dSMauro Carvalho Chehab* temp#_auto_temp_min 219b04f2f7dSMauro Carvalho Chehab - temperature over which fans start to spin. 220b04f2f7dSMauro Carvalho Chehab* temp#_auto_temp_max 221b04f2f7dSMauro Carvalho Chehab - temperature when fans spin at full speed. 222b04f2f7dSMauro Carvalho Chehab* temp#_auto_temp_crit 223b04f2f7dSMauro Carvalho Chehab - temperature when all fans will run full speed. 2247f15b664SR.Marek@sh.cvut.cz 225b04f2f7dSMauro Carvalho ChehabPWM Control 226b04f2f7dSMauro Carvalho Chehab^^^^^^^^^^^ 2277f15b664SR.Marek@sh.cvut.cz 2287f15b664SR.Marek@sh.cvut.czThere are three PWM outputs. The LM85 datasheet suggests that the 2297f15b664SR.Marek@sh.cvut.czpwm3 output control both fan3 and fan4. Each PWM can be individually 230a33f3224SFrancis Galiegueconfigured and assigned to a zone for its control value. Each PWM can be 2317f15b664SR.Marek@sh.cvut.czconfigured individually according to the following options. 2327f15b664SR.Marek@sh.cvut.cz 233b04f2f7dSMauro Carvalho Chehab* pwm#_auto_pwm_min 234b04f2f7dSMauro Carvalho Chehab - this specifies the PWM value for temp#_auto_temp_off 2357f15b664SR.Marek@sh.cvut.cz temperature. (PWM value from 0 to 255) 2367f15b664SR.Marek@sh.cvut.cz 237b04f2f7dSMauro Carvalho Chehab* pwm#_auto_pwm_minctl 238b04f2f7dSMauro Carvalho Chehab - this flags selects for temp#_auto_temp_off temperature 23977fa49d9SJean Delvare the behaviour of fans. Write 1 to let fans spinning at 2407f15b664SR.Marek@sh.cvut.cz pwm#_auto_pwm_min or write 0 to let them off. 2417f15b664SR.Marek@sh.cvut.cz 242b04f2f7dSMauro Carvalho Chehab.. note:: 2437f15b664SR.Marek@sh.cvut.cz 244b04f2f7dSMauro Carvalho Chehab It has been reported that there is a bug in the LM85 that causes 245b04f2f7dSMauro Carvalho Chehab the flag to be associated with the zones not the PWMs. This 246b04f2f7dSMauro Carvalho Chehab contradicts all the published documentation. Setting pwm#_min_ctl 247b04f2f7dSMauro Carvalho Chehab in this case actually affects all PWMs controlled by zone '#'. 2487f15b664SR.Marek@sh.cvut.cz 249b04f2f7dSMauro Carvalho ChehabPWM Controlling Zone selection 250b04f2f7dSMauro Carvalho Chehab^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 251b04f2f7dSMauro Carvalho Chehab 252b04f2f7dSMauro Carvalho Chehab* pwm#_auto_channels 253b04f2f7dSMauro Carvalho Chehab - controls zone that is associated with PWM 2547f15b664SR.Marek@sh.cvut.cz 2557f15b664SR.Marek@sh.cvut.czConfiguration choices: 2567f15b664SR.Marek@sh.cvut.cz 257b04f2f7dSMauro Carvalho Chehab========== ============================================= 2587f15b664SR.Marek@sh.cvut.czValue Meaning 259b04f2f7dSMauro Carvalho Chehab========== ============================================= 2607f15b664SR.Marek@sh.cvut.cz 1 Controlled by Zone 1 2617f15b664SR.Marek@sh.cvut.cz 2 Controlled by Zone 2 2627f15b664SR.Marek@sh.cvut.cz 3 Controlled by Zone 3 2637f15b664SR.Marek@sh.cvut.cz 23 Controlled by higher temp of Zone 2 or 3 2647f15b664SR.Marek@sh.cvut.cz 123 Controlled by highest temp of Zone 1, 2 or 3 2657f15b664SR.Marek@sh.cvut.cz 0 PWM always 0% (off) 2667f15b664SR.Marek@sh.cvut.cz -1 PWM always 100% (full on) 2677f15b664SR.Marek@sh.cvut.cz -2 Manual control (write to 'pwm#' to set) 268b04f2f7dSMauro Carvalho Chehab========== ============================================= 2697f15b664SR.Marek@sh.cvut.cz 2707f15b664SR.Marek@sh.cvut.czThe National LM85's have two vendor specific configuration 2717f15b664SR.Marek@sh.cvut.czfeatures. Tach. mode and Spinup Control. For more details on these, 272dd1ac538SJean Delvaresee the LM85 datasheet or Application Note AN-1260. These features 273dd1ac538SJean Delvareare not currently supported by the lm85 driver. 2747f15b664SR.Marek@sh.cvut.cz 2757f15b664SR.Marek@sh.cvut.czThe Analog Devices ADM1027 has several vendor specific enhancements. 2767f15b664SR.Marek@sh.cvut.czThe number of pulses-per-rev of the fans can be set, Tach monitoring 2777f15b664SR.Marek@sh.cvut.czcan be optimized for PWM operation, and an offset can be applied to 2787f15b664SR.Marek@sh.cvut.czthe temperatures to compensate for systemic errors in the 279dd1ac538SJean Delvaremeasurements. These features are not currently supported by the lm85 280dd1ac538SJean Delvaredriver. 2817f15b664SR.Marek@sh.cvut.cz 282c36364dbSJean DelvareIn addition to the ADM1027 features, the ADT7463 and ADT7468 also have 283c36364dbSJean DelvareTmin control and THERM asserted counts. Automatic Tmin control acts to 284c36364dbSJean Delvareadjust the Tmin value to maintain the measured temperature sensor at a 285c36364dbSJean Delvarespecified temperature. There isn't much documentation on this feature in 286c36364dbSJean Delvarethe ADT7463 data sheet. This is not supported by current driver. 287