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