xref: /OK3568_Linux_fs/kernel/Documentation/hwmon/w83781d.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunKernel driver w83781d
2*4882a593Smuzhiyun=====================
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunSupported chips:
5*4882a593Smuzhiyun
6*4882a593Smuzhiyun  * Winbond W83781D
7*4882a593Smuzhiyun
8*4882a593Smuzhiyun    Prefix: 'w83781d'
9*4882a593Smuzhiyun
10*4882a593Smuzhiyun    Addresses scanned: I2C 0x28 - 0x2f, ISA 0x290 (8 I/O ports)
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun    Datasheet: http://www.winbond-usa.com/products/winbond_products/pdfs/PCIC/w83781d.pdf
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun  * Winbond W83782D
15*4882a593Smuzhiyun
16*4882a593Smuzhiyun    Prefix: 'w83782d'
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun    Addresses scanned: I2C 0x28 - 0x2f, ISA 0x290 (8 I/O ports)
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun    Datasheet: https://www.winbond.com
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun  * Winbond W83783S
23*4882a593Smuzhiyun
24*4882a593Smuzhiyun    Prefix: 'w83783s'
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun    Addresses scanned: I2C 0x2d
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun    Datasheet: http://www.winbond-usa.com/products/winbond_products/pdfs/PCIC/w83783s.pdf
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun  * Asus AS99127F
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun    Prefix: 'as99127f'
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun    Addresses scanned: I2C 0x28 - 0x2f
35*4882a593Smuzhiyun
36*4882a593Smuzhiyun    Datasheet: Unavailable from Asus
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun
39*4882a593Smuzhiyun
40*4882a593SmuzhiyunAuthors:
41*4882a593Smuzhiyun
42*4882a593Smuzhiyun      - Frodo Looijaard <frodol@dds.nl>,
43*4882a593Smuzhiyun      - Philip Edelbrock <phil@netroedge.com>,
44*4882a593Smuzhiyun      - Mark Studebaker <mdsxyz123@yahoo.com>
45*4882a593Smuzhiyun
46*4882a593SmuzhiyunModule parameters
47*4882a593Smuzhiyun-----------------
48*4882a593Smuzhiyun
49*4882a593Smuzhiyun* init int
50*4882a593Smuzhiyun    (default 1)
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun    Use 'init=0' to bypass initializing the chip.
53*4882a593Smuzhiyun    Try this if your computer crashes when you load the module.
54*4882a593Smuzhiyun
55*4882a593Smuzhiyun* reset int
56*4882a593Smuzhiyun    (default 0)
57*4882a593Smuzhiyun    The driver used to reset the chip on load, but does no more. Use
58*4882a593Smuzhiyun    'reset=1' to restore the old behavior. Report if you need to do this.
59*4882a593Smuzhiyun
60*4882a593Smuzhiyunforce_subclients=bus,caddr,saddr,saddr
61*4882a593Smuzhiyun  This is used to force the i2c addresses for subclients of
62*4882a593Smuzhiyun  a certain chip. Typical usage is `force_subclients=0,0x2d,0x4a,0x4b`
63*4882a593Smuzhiyun  to force the subclients of chip 0x2d on bus 0 to i2c addresses
64*4882a593Smuzhiyun  0x4a and 0x4b. This parameter is useful for certain Tyan boards.
65*4882a593Smuzhiyun
66*4882a593SmuzhiyunDescription
67*4882a593Smuzhiyun-----------
68*4882a593Smuzhiyun
69*4882a593SmuzhiyunThis driver implements support for the Winbond W83781D, W83782D, W83783S
70*4882a593Smuzhiyunchips, and the Asus AS99127F chips. We will refer to them collectively as
71*4882a593SmuzhiyunW8378* chips.
72*4882a593Smuzhiyun
73*4882a593SmuzhiyunThere is quite some difference between these chips, but they are similar
74*4882a593Smuzhiyunenough that it was sensible to put them together in one driver.
75*4882a593SmuzhiyunThe Asus chips are similar to an I2C-only W83782D.
76*4882a593Smuzhiyun
77*4882a593Smuzhiyun+----------+---------+--------+-------+-------+---------+--------+------+-----+
78*4882a593Smuzhiyun| Chip     | #vin    | #fanin | #pwm  | #temp | wchipid | vendid | i2c  | ISA |
79*4882a593Smuzhiyun+----------+---------+--------+-------+-------+---------+--------+------+-----+
80*4882a593Smuzhiyun| as99127f | 7       | 3      | 0     | 3     | 0x31    | 0x12c3 | yes  |  no |
81*4882a593Smuzhiyun+----------+---------+--------+-------+-------+---------+--------+------+-----+
82*4882a593Smuzhiyun| as99127f rev.2 (type_name = as99127f)       | 0x31    | 0x5ca3 | yes  |  no |
83*4882a593Smuzhiyun+----------+---------+--------+-------+-------+---------+--------+------+-----+
84*4882a593Smuzhiyun| w83781d  | 7       | 3      | 0     | 3     | 0x10-1  | 0x5ca3 | yes  | yes |
85*4882a593Smuzhiyun+----------+---------+--------+-------+-------+---------+--------+------+-----+
86*4882a593Smuzhiyun| w83782d  | 9       | 3      | 2-4   | 3     | 0x30    | 0x5ca3 | yes  | yes |
87*4882a593Smuzhiyun+----------+---------+--------+-------+-------+---------+--------+------+-----+
88*4882a593Smuzhiyun| w83783s  | 5-6     | 3      | 2     |  1-2  | 0x40    | 0x5ca3 | yes  |  no |
89*4882a593Smuzhiyun+----------+---------+--------+-------+-------+---------+--------+------+-----+
90*4882a593Smuzhiyun
91*4882a593SmuzhiyunDetection of these chips can sometimes be foiled because they can be in
92*4882a593Smuzhiyunan internal state that allows no clean access. If you know the address
93*4882a593Smuzhiyunof the chip, use a 'force' parameter; this will put them into a more
94*4882a593Smuzhiyunwell-behaved state first.
95*4882a593Smuzhiyun
96*4882a593SmuzhiyunThe W8378* implements temperature sensors (three on the W83781D and W83782D,
97*4882a593Smuzhiyuntwo on the W83783S), three fan rotation speed sensors, voltage sensors
98*4882a593Smuzhiyun(seven on the W83781D, nine on the W83782D and six on the W83783S), VID
99*4882a593Smuzhiyunlines, alarms with beep warnings, and some miscellaneous stuff.
100*4882a593Smuzhiyun
101*4882a593SmuzhiyunTemperatures are measured in degrees Celsius. There is always one main
102*4882a593Smuzhiyuntemperature sensor, and one (W83783S) or two (W83781D and W83782D) other
103*4882a593Smuzhiyunsensors. An alarm is triggered for the main sensor once when the
104*4882a593SmuzhiyunOvertemperature Shutdown limit is crossed; it is triggered again as soon as
105*4882a593Smuzhiyunit drops below the Hysteresis value. A more useful behavior
106*4882a593Smuzhiyuncan be found by setting the Hysteresis value to +127 degrees Celsius; in
107*4882a593Smuzhiyunthis case, alarms are issued during all the time when the actual temperature
108*4882a593Smuzhiyunis above the Overtemperature Shutdown value. The driver sets the
109*4882a593Smuzhiyunhysteresis value for temp1 to 127 at initialization.
110*4882a593Smuzhiyun
111*4882a593SmuzhiyunFor the other temperature sensor(s), an alarm is triggered when the
112*4882a593Smuzhiyuntemperature gets higher then the Overtemperature Shutdown value; it stays
113*4882a593Smuzhiyunon until the temperature falls below the Hysteresis value. But on the
114*4882a593SmuzhiyunW83781D, there is only one alarm that functions for both other sensors!
115*4882a593SmuzhiyunTemperatures are guaranteed within a range of -55 to +125 degrees. The
116*4882a593Smuzhiyunmain temperature sensors has a resolution of 1 degree; the other sensor(s)
117*4882a593Smuzhiyunof 0.5 degree.
118*4882a593Smuzhiyun
119*4882a593SmuzhiyunFan rotation speeds are reported in RPM (rotations per minute). An alarm is
120*4882a593Smuzhiyuntriggered if the rotation speed has dropped below a programmable limit. Fan
121*4882a593Smuzhiyunreadings can be divided by a programmable divider (1, 2, 4 or 8 for the
122*4882a593SmuzhiyunW83781D; 1, 2, 4, 8, 16, 32, 64 or 128 for the others) to give
123*4882a593Smuzhiyunthe readings more range or accuracy. Not all RPM values can accurately
124*4882a593Smuzhiyunbe represented, so some rounding is done. With a divider of 2, the lowest
125*4882a593Smuzhiyunrepresentable value is around 2600 RPM.
126*4882a593Smuzhiyun
127*4882a593SmuzhiyunVoltage sensors (also known as IN sensors) report their values in volts.
128*4882a593SmuzhiyunAn alarm is triggered if the voltage has crossed a programmable minimum
129*4882a593Smuzhiyunor maximum limit. Note that minimum in this case always means 'closest to
130*4882a593Smuzhiyunzero'; this is important for negative voltage measurements. All voltage
131*4882a593Smuzhiyuninputs can measure voltages between 0 and 4.08 volts, with a resolution
132*4882a593Smuzhiyunof 0.016 volt.
133*4882a593Smuzhiyun
134*4882a593SmuzhiyunThe VID lines encode the core voltage value: the voltage level your processor
135*4882a593Smuzhiyunshould work with. This is hardcoded by the mainboard and/or processor itself.
136*4882a593SmuzhiyunIt is a value in volts. When it is unconnected, you will often find the
137*4882a593Smuzhiyunvalue 3.50 V here.
138*4882a593Smuzhiyun
139*4882a593SmuzhiyunThe W83782D and W83783S temperature conversion machine understands about
140*4882a593Smuzhiyunseveral kinds of temperature probes. You can program the so-called
141*4882a593Smuzhiyunbeta value in the sensor files. '1' is the PII/Celeron diode, '2' is the
142*4882a593SmuzhiyunTN3904 transistor, and 3435 the default thermistor value. Other values
143*4882a593Smuzhiyunare (not yet) supported.
144*4882a593Smuzhiyun
145*4882a593SmuzhiyunIn addition to the alarms described above, there is a CHAS alarm on the
146*4882a593Smuzhiyunchips which triggers if your computer case is open.
147*4882a593Smuzhiyun
148*4882a593SmuzhiyunWhen an alarm goes off, you can be warned by a beeping signal through
149*4882a593Smuzhiyunyour computer speaker. It is possible to enable all beeping globally,
150*4882a593Smuzhiyunor only the beeping for some alarms.
151*4882a593Smuzhiyun
152*4882a593SmuzhiyunIndividual alarm and beep bits:
153*4882a593Smuzhiyun
154*4882a593Smuzhiyun======== ==========================
155*4882a593Smuzhiyun0x000001 in0
156*4882a593Smuzhiyun0x000002 in1
157*4882a593Smuzhiyun0x000004 in2
158*4882a593Smuzhiyun0x000008 in3
159*4882a593Smuzhiyun0x000010 temp1
160*4882a593Smuzhiyun0x000020 temp2 (+temp3 on W83781D)
161*4882a593Smuzhiyun0x000040 fan1
162*4882a593Smuzhiyun0x000080 fan2
163*4882a593Smuzhiyun0x000100 in4
164*4882a593Smuzhiyun0x000200 in5
165*4882a593Smuzhiyun0x000400 in6
166*4882a593Smuzhiyun0x000800 fan3
167*4882a593Smuzhiyun0x001000 chassis
168*4882a593Smuzhiyun0x002000 temp3 (W83782D only)
169*4882a593Smuzhiyun0x010000 in7 (W83782D only)
170*4882a593Smuzhiyun0x020000 in8 (W83782D only)
171*4882a593Smuzhiyun======== ==========================
172*4882a593Smuzhiyun
173*4882a593SmuzhiyunIf an alarm triggers, it will remain triggered until the hardware register
174*4882a593Smuzhiyunis read at least once. This means that the cause for the alarm may
175*4882a593Smuzhiyunalready have disappeared! Note that in the current implementation, all
176*4882a593Smuzhiyunhardware registers are read whenever any data is read (unless it is less
177*4882a593Smuzhiyunthan 1.5 seconds since the last update). This means that you can easily
178*4882a593Smuzhiyunmiss once-only alarms.
179*4882a593Smuzhiyun
180*4882a593SmuzhiyunThe chips only update values each 1.5 seconds; reading them more often
181*4882a593Smuzhiyunwill do no harm, but will return 'old' values.
182*4882a593Smuzhiyun
183*4882a593SmuzhiyunAS99127F PROBLEMS
184*4882a593Smuzhiyun-----------------
185*4882a593SmuzhiyunThe as99127f support was developed without the benefit of a datasheet.
186*4882a593SmuzhiyunIn most cases it is treated as a w83781d (although revision 2 of the
187*4882a593SmuzhiyunAS99127F looks more like a w83782d).
188*4882a593SmuzhiyunThis support will be BETA until a datasheet is released.
189*4882a593SmuzhiyunOne user has reported problems with fans stopping
190*4882a593Smuzhiyunoccasionally.
191*4882a593Smuzhiyun
192*4882a593SmuzhiyunNote that the individual beep bits are inverted from the other chips.
193*4882a593SmuzhiyunThe driver now takes care of this so that user-space applications
194*4882a593Smuzhiyundon't have to know about it.
195*4882a593Smuzhiyun
196*4882a593SmuzhiyunKnown problems:
197*4882a593Smuzhiyun	- Problems with diode/thermistor settings (supported?)
198*4882a593Smuzhiyun	- One user reports fans stopping under high server load.
199*4882a593Smuzhiyun	- Revision 2 seems to have 2 PWM registers but we don't know
200*4882a593Smuzhiyun	  how to handle them. More details below.
201*4882a593Smuzhiyun
202*4882a593SmuzhiyunThese will not be fixed unless we get a datasheet.
203*4882a593SmuzhiyunIf you have problems, please lobby Asus to release a datasheet.
204*4882a593SmuzhiyunUnfortunately several others have without success.
205*4882a593SmuzhiyunPlease do not send mail to us asking for better as99127f support.
206*4882a593SmuzhiyunWe have done the best we can without a datasheet.
207*4882a593SmuzhiyunPlease do not send mail to the author or the sensors group asking for
208*4882a593Smuzhiyuna datasheet or ideas on how to convince Asus. We can't help.
209*4882a593Smuzhiyun
210*4882a593Smuzhiyun
211*4882a593SmuzhiyunNOTES
212*4882a593Smuzhiyun-----
213*4882a593Smuzhiyun  783s has no in1 so that in[2-6] are compatible with the 781d/782d.
214*4882a593Smuzhiyun
215*4882a593Smuzhiyun  783s pin is programmable for -5V or temp1; defaults to -5V,
216*4882a593Smuzhiyun  no control in driver so temp1 doesn't work.
217*4882a593Smuzhiyun
218*4882a593Smuzhiyun  782d and 783s datasheets differ on which is pwm1 and which is pwm2.
219*4882a593Smuzhiyun  We chose to follow 782d.
220*4882a593Smuzhiyun
221*4882a593Smuzhiyun  782d and 783s pin is programmable for fan3 input or pwm2 output;
222*4882a593Smuzhiyun  defaults to fan3 input.
223*4882a593Smuzhiyun  If pwm2 is enabled (with echo 255 1 > pwm2), then
224*4882a593Smuzhiyun  fan3 will report 0.
225*4882a593Smuzhiyun
226*4882a593Smuzhiyun  782d has pwm1-2 for ISA, pwm1-4 for i2c. (pwm3-4 share pins with
227*4882a593Smuzhiyun  the ISA pins)
228*4882a593Smuzhiyun
229*4882a593SmuzhiyunData sheet updates
230*4882a593Smuzhiyun------------------
231*4882a593Smuzhiyun	- PWM clock registers:
232*4882a593Smuzhiyun		* 000: master /  512
233*4882a593Smuzhiyun		* 001: master / 1024
234*4882a593Smuzhiyun		* 010: master / 2048
235*4882a593Smuzhiyun		* 011: master / 4096
236*4882a593Smuzhiyun		* 100: master / 8192
237*4882a593Smuzhiyun
238*4882a593Smuzhiyun
239*4882a593SmuzhiyunAnswers from Winbond tech support
240*4882a593Smuzhiyun---------------------------------
241*4882a593Smuzhiyun
242*4882a593Smuzhiyun::
243*4882a593Smuzhiyun
244*4882a593Smuzhiyun  >
245*4882a593Smuzhiyun  > 1) In the W83781D data sheet section 7.2 last paragraph, it talks about
246*4882a593Smuzhiyun  >    reprogramming the R-T table if the Beta of the thermistor is not
247*4882a593Smuzhiyun  >    3435K. The R-T table is described briefly in section 8.20.
248*4882a593Smuzhiyun  >    What formulas do I use to program a new R-T table for a given Beta?
249*4882a593Smuzhiyun  >
250*4882a593Smuzhiyun
251*4882a593Smuzhiyun  We are sorry that the calculation for R-T table value is
252*4882a593Smuzhiyun  confidential. If you have another Beta value of thermistor, we can help
253*4882a593Smuzhiyun  to calculate the R-T table for you. But you should give us real R-T
254*4882a593Smuzhiyun  Table which can be gotten by thermistor vendor. Therefore we will calculate
255*4882a593Smuzhiyun  them and obtain 32-byte data, and you can fill the 32-byte data to the
256*4882a593Smuzhiyun  register in Bank0.CR51 of W83781D.
257*4882a593Smuzhiyun
258*4882a593Smuzhiyun
259*4882a593Smuzhiyun  > 2) In the W83782D data sheet, it mentions that pins 38, 39, and 40 are
260*4882a593Smuzhiyun  >    programmable to be either thermistor or Pentium II diode inputs.
261*4882a593Smuzhiyun  >    How do I program them for diode inputs? I can't find any register
262*4882a593Smuzhiyun  >    to program these to be diode inputs.
263*4882a593Smuzhiyun
264*4882a593Smuzhiyun  You may program Bank0 CR[5Dh] and CR[59h] registers.
265*4882a593Smuzhiyun
266*4882a593Smuzhiyun  =============================== =============== ============== ============
267*4882a593Smuzhiyun	CR[5Dh]    		bit 1(VTIN1)    bit 2(VTIN2)   bit 3(VTIN3)
268*4882a593Smuzhiyun
269*4882a593Smuzhiyun		thermistor                0		 0		0
270*4882a593Smuzhiyun	diode 			  1		 1		1
271*4882a593Smuzhiyun
272*4882a593Smuzhiyun
273*4882a593Smuzhiyun  (error) CR[59h] 		bit 4(VTIN1)	bit 2(VTIN2)   bit 3(VTIN3)
274*4882a593Smuzhiyun  (right) CR[59h] 		bit 4(VTIN1)	bit 5(VTIN2)   bit 6(VTIN3)
275*4882a593Smuzhiyun
276*4882a593Smuzhiyun	PII thermal diode         1		 1		1
277*4882a593Smuzhiyun	2N3904	diode		  0		 0		0
278*4882a593Smuzhiyun  =============================== =============== ============== ============
279*4882a593Smuzhiyun
280*4882a593Smuzhiyun
281*4882a593SmuzhiyunAsus Clones
282*4882a593Smuzhiyun-----------
283*4882a593Smuzhiyun
284*4882a593SmuzhiyunWe have no datasheets for the Asus clones (AS99127F and ASB100 Bach).
285*4882a593SmuzhiyunHere are some very useful information that were given to us by Alex Van
286*4882a593SmuzhiyunKaam about how to detect these chips, and how to read their values. He
287*4882a593Smuzhiyunalso gives advice for another Asus chipset, the Mozart-2 (which we
288*4882a593Smuzhiyundon't support yet). Thanks Alex!
289*4882a593Smuzhiyun
290*4882a593SmuzhiyunI reworded some parts and added personal comments.
291*4882a593Smuzhiyun
292*4882a593SmuzhiyunDetection
293*4882a593Smuzhiyun^^^^^^^^^
294*4882a593Smuzhiyun
295*4882a593SmuzhiyunAS99127F rev.1, AS99127F rev.2 and ASB100:
296*4882a593Smuzhiyun- I2C address range: 0x29 - 0x2F
297*4882a593Smuzhiyun- If register 0x58 holds 0x31 then we have an Asus (either ASB100 or AS99127F)
298*4882a593Smuzhiyun- Which one depends on register 0x4F (manufacturer ID):
299*4882a593Smuzhiyun
300*4882a593Smuzhiyun  - 0x06 or 0x94: ASB100
301*4882a593Smuzhiyun  - 0x12 or 0xC3: AS99127F rev.1
302*4882a593Smuzhiyun  - 0x5C or 0xA3: AS99127F rev.2
303*4882a593Smuzhiyun
304*4882a593Smuzhiyun  Note that 0x5CA3 is Winbond's ID (WEC), which let us think Asus get their
305*4882a593Smuzhiyun  AS99127F rev.2 direct from Winbond. The other codes mean ATT and DVC,
306*4882a593Smuzhiyun  respectively. ATT could stand for Asustek something (although it would be
307*4882a593Smuzhiyun  very badly chosen IMHO), I don't know what DVC could stand for. Maybe
308*4882a593Smuzhiyun  these codes simply aren't meant to be decoded that way.
309*4882a593Smuzhiyun
310*4882a593SmuzhiyunMozart-2:
311*4882a593Smuzhiyun- I2C address: 0x77
312*4882a593Smuzhiyun- If register 0x58 holds 0x56 or 0x10 then we have a Mozart-2
313*4882a593Smuzhiyun- Of the Mozart there are 3 types:
314*4882a593Smuzhiyun
315*4882a593Smuzhiyun  - 0x58=0x56, 0x4E=0x94, 0x4F=0x36: Asus ASM58 Mozart-2
316*4882a593Smuzhiyun  - 0x58=0x56, 0x4E=0x94, 0x4F=0x06: Asus AS2K129R Mozart-2
317*4882a593Smuzhiyun  - 0x58=0x10, 0x4E=0x5C, 0x4F=0xA3: Asus ??? Mozart-2
318*4882a593Smuzhiyun
319*4882a593Smuzhiyun  You can handle all 3 the exact same way :)
320*4882a593Smuzhiyun
321*4882a593SmuzhiyunTemperature sensors
322*4882a593Smuzhiyun^^^^^^^^^^^^^^^^^^^
323*4882a593Smuzhiyun
324*4882a593SmuzhiyunASB100:
325*4882a593Smuzhiyun  - sensor 1: register 0x27
326*4882a593Smuzhiyun  - sensor 2 & 3 are the 2 LM75's on the SMBus
327*4882a593Smuzhiyun  - sensor 4: register 0x17
328*4882a593Smuzhiyun
329*4882a593SmuzhiyunRemark:
330*4882a593Smuzhiyun
331*4882a593Smuzhiyun  I noticed that on Intel boards sensor 2 is used for the CPU
332*4882a593Smuzhiyun  and 4 is ignored/stuck, on AMD boards sensor 4 is the CPU and sensor 2 is
333*4882a593Smuzhiyun  either ignored or a socket temperature.
334*4882a593Smuzhiyun
335*4882a593SmuzhiyunAS99127F (rev.1 and 2 alike):
336*4882a593Smuzhiyun  - sensor 1: register 0x27
337*4882a593Smuzhiyun  - sensor 2 & 3 are the 2 LM75's on the SMBus
338*4882a593Smuzhiyun
339*4882a593SmuzhiyunRemark:
340*4882a593Smuzhiyun
341*4882a593Smuzhiyun  Register 0x5b is suspected to be temperature type selector. Bit 1
342*4882a593Smuzhiyun  would control temp1, bit 3 temp2 and bit 5 temp3.
343*4882a593Smuzhiyun
344*4882a593SmuzhiyunMozart-2:
345*4882a593Smuzhiyun  - sensor 1: register 0x27
346*4882a593Smuzhiyun  - sensor 2: register 0x13
347*4882a593Smuzhiyun
348*4882a593SmuzhiyunFan sensors
349*4882a593Smuzhiyun^^^^^^^^^^^
350*4882a593Smuzhiyun
351*4882a593SmuzhiyunASB100, AS99127F (rev.1 and 2 alike):
352*4882a593Smuzhiyun  - 3 fans, identical to the W83781D
353*4882a593Smuzhiyun
354*4882a593SmuzhiyunMozart-2:
355*4882a593Smuzhiyun  - 2 fans only, 1350000/RPM/div
356*4882a593Smuzhiyun  - fan 1: register 0x28,  divisor on register 0xA1 (bits 4-5)
357*4882a593Smuzhiyun  - fan 2: register 0x29,  divisor on register 0xA1 (bits 6-7)
358*4882a593Smuzhiyun
359*4882a593SmuzhiyunVoltages
360*4882a593Smuzhiyun^^^^^^^^
361*4882a593Smuzhiyun
362*4882a593SmuzhiyunThis is where there is a difference between AS99127F rev.1 and 2.
363*4882a593Smuzhiyun
364*4882a593SmuzhiyunRemark:
365*4882a593Smuzhiyun
366*4882a593Smuzhiyun  The difference is similar to the difference between
367*4882a593Smuzhiyun  W83781D and W83782D.
368*4882a593Smuzhiyun
369*4882a593SmuzhiyunASB100:
370*4882a593Smuzhiyun  - in0=r(0x20)*0.016
371*4882a593Smuzhiyun  - in1=r(0x21)*0.016
372*4882a593Smuzhiyun  - in2=r(0x22)*0.016
373*4882a593Smuzhiyun  - in3=r(0x23)*0.016*1.68
374*4882a593Smuzhiyun  - in4=r(0x24)*0.016*3.8
375*4882a593Smuzhiyun  - in5=r(0x25)*(-0.016)*3.97
376*4882a593Smuzhiyun  - in6=r(0x26)*(-0.016)*1.666
377*4882a593Smuzhiyun
378*4882a593SmuzhiyunAS99127F rev.1:
379*4882a593Smuzhiyun  - in0=r(0x20)*0.016
380*4882a593Smuzhiyun  - in1=r(0x21)*0.016
381*4882a593Smuzhiyun  - in2=r(0x22)*0.016
382*4882a593Smuzhiyun  - in3=r(0x23)*0.016*1.68
383*4882a593Smuzhiyun  - in4=r(0x24)*0.016*3.8
384*4882a593Smuzhiyun  - in5=r(0x25)*(-0.016)*3.97
385*4882a593Smuzhiyun  - in6=r(0x26)*(-0.016)*1.503
386*4882a593Smuzhiyun
387*4882a593SmuzhiyunAS99127F rev.2:
388*4882a593Smuzhiyun  - in0=r(0x20)*0.016
389*4882a593Smuzhiyun  - in1=r(0x21)*0.016
390*4882a593Smuzhiyun  - in2=r(0x22)*0.016
391*4882a593Smuzhiyun  - in3=r(0x23)*0.016*1.68
392*4882a593Smuzhiyun  - in4=r(0x24)*0.016*3.8
393*4882a593Smuzhiyun  - in5=(r(0x25)*0.016-3.6)*5.14+3.6
394*4882a593Smuzhiyun  - in6=(r(0x26)*0.016-3.6)*3.14+3.6
395*4882a593Smuzhiyun
396*4882a593SmuzhiyunMozart-2:
397*4882a593Smuzhiyun  - in0=r(0x20)*0.016
398*4882a593Smuzhiyun  - in1=255
399*4882a593Smuzhiyun  - in2=r(0x22)*0.016
400*4882a593Smuzhiyun  - in3=r(0x23)*0.016*1.68
401*4882a593Smuzhiyun  - in4=r(0x24)*0.016*4
402*4882a593Smuzhiyun  - in5=255
403*4882a593Smuzhiyun  - in6=255
404*4882a593Smuzhiyun
405*4882a593Smuzhiyun
406*4882a593SmuzhiyunPWM
407*4882a593Smuzhiyun^^^
408*4882a593Smuzhiyun
409*4882a593Smuzhiyun* Additional info about PWM on the AS99127F (may apply to other Asus
410*4882a593Smuzhiyun  chips as well) by Jean Delvare as of 2004-04-09:
411*4882a593Smuzhiyun
412*4882a593SmuzhiyunAS99127F revision 2 seems to have two PWM registers at 0x59 and 0x5A,
413*4882a593Smuzhiyunand a temperature sensor type selector at 0x5B (which basically means
414*4882a593Smuzhiyunthat they swapped registers 0x59 and 0x5B when you compare with Winbond
415*4882a593Smuzhiyunchips).
416*4882a593SmuzhiyunRevision 1 of the chip also has the temperature sensor type selector at
417*4882a593Smuzhiyun0x5B, but PWM registers have no effect.
418*4882a593Smuzhiyun
419*4882a593SmuzhiyunWe don't know exactly how the temperature sensor type selection works.
420*4882a593SmuzhiyunLooks like bits 1-0 are for temp1, bits 3-2 for temp2 and bits 5-4 for
421*4882a593Smuzhiyuntemp3, although it is possible that only the most significant bit matters
422*4882a593Smuzhiyuneach time. So far, values other than 0 always broke the readings.
423*4882a593Smuzhiyun
424*4882a593SmuzhiyunPWM registers seem to be split in two parts: bit 7 is a mode selector,
425*4882a593Smuzhiyunwhile the other bits seem to define a value or threshold.
426*4882a593Smuzhiyun
427*4882a593SmuzhiyunWhen bit 7 is clear, bits 6-0 seem to hold a threshold value. If the value
428*4882a593Smuzhiyunis below a given limit, the fan runs at low speed. If the value is above
429*4882a593Smuzhiyunthe limit, the fan runs at full speed. We have no clue as to what the limit
430*4882a593Smuzhiyunrepresents. Note that there seem to be some inertia in this mode, speed
431*4882a593Smuzhiyunchanges may need some time to trigger. Also, an hysteresis mechanism is
432*4882a593Smuzhiyunsuspected since walking through all the values increasingly and then
433*4882a593Smuzhiyundecreasingly led to slightly different limits.
434*4882a593Smuzhiyun
435*4882a593SmuzhiyunWhen bit 7 is set, bits 3-0 seem to hold a threshold value, while bits 6-4
436*4882a593Smuzhiyunwould not be significant. If the value is below a given limit, the fan runs
437*4882a593Smuzhiyunat full speed, while if it is above the limit it runs at low speed (so this
438*4882a593Smuzhiyunis the contrary of the other mode, in a way). Here again, we don't know
439*4882a593Smuzhiyunwhat the limit is supposed to represent.
440*4882a593Smuzhiyun
441*4882a593SmuzhiyunOne remarkable thing is that the fans would only have two or three
442*4882a593Smuzhiyundifferent speeds (transitional states left apart), not a whole range as
443*4882a593Smuzhiyunyou usually get with PWM.
444*4882a593Smuzhiyun
445*4882a593SmuzhiyunAs a conclusion, you can write 0x00 or 0x8F to the PWM registers to make
446*4882a593Smuzhiyunfans run at low speed, and 0x7F or 0x80 to make them run at full speed.
447*4882a593Smuzhiyun
448*4882a593SmuzhiyunPlease contact us if you can figure out how it is supposed to work. As
449*4882a593Smuzhiyunlong as we don't know more, the w83781d driver doesn't handle PWM on
450*4882a593SmuzhiyunAS99127F chips at all.
451*4882a593Smuzhiyun
452*4882a593Smuzhiyun* Additional info about PWM on the AS99127F rev.1 by Hector Martin:
453*4882a593Smuzhiyun
454*4882a593SmuzhiyunI've been fiddling around with the (in)famous 0x59 register and
455*4882a593Smuzhiyunfound out the following values do work as a form of coarse pwm:
456*4882a593Smuzhiyun
457*4882a593Smuzhiyun0x80
458*4882a593Smuzhiyun - seems to turn fans off after some time(1-2 minutes)... might be
459*4882a593Smuzhiyun   some form of auto-fan-control based on temp? hmm (Qfan? this mobo is an
460*4882a593Smuzhiyun   old ASUS, it isn't marketed as Qfan. Maybe some beta pre-attempt at Qfan
461*4882a593Smuzhiyun   that was dropped at the BIOS)
462*4882a593Smuzhiyun0x81
463*4882a593Smuzhiyun - off
464*4882a593Smuzhiyun0x82
465*4882a593Smuzhiyun - slightly "on-ner" than off, but my fans do not get to move. I can
466*4882a593Smuzhiyun   hear the high-pitched PWM sound that motors give off at too-low-pwm.
467*4882a593Smuzhiyun0x83
468*4882a593Smuzhiyun - now they do move. Estimate about 70% speed or so.
469*4882a593Smuzhiyun0x84-0x8f
470*4882a593Smuzhiyun - full on
471*4882a593Smuzhiyun
472*4882a593SmuzhiyunChanging the high nibble doesn't seem to do much except the high bit
473*4882a593Smuzhiyun(0x80) must be set for PWM to work, else the current pwm doesn't seem to
474*4882a593Smuzhiyunchange.
475*4882a593Smuzhiyun
476*4882a593SmuzhiyunMy mobo is an ASUS A7V266-E. This behavior is similar to what I got
477*4882a593Smuzhiyunwith speedfan under Windows, where 0-15% would be off, 15-2x% (can't
478*4882a593Smuzhiyunremember the exact value) would be 70% and higher would be full on.
479*4882a593Smuzhiyun
480*4882a593Smuzhiyun* Additional info about PWM on the AS99127F rev.1 from lm-sensors
481*4882a593Smuzhiyun  ticket #2350:
482*4882a593Smuzhiyun
483*4882a593SmuzhiyunI conducted some experiment on Asus P3B-F motherboard with AS99127F
484*4882a593Smuzhiyun(Ver. 1).
485*4882a593Smuzhiyun
486*4882a593SmuzhiyunI confirm that 0x59 register control the CPU_Fan Header on this
487*4882a593Smuzhiyunmotherboard, and 0x5a register control PWR_Fan.
488*4882a593Smuzhiyun
489*4882a593SmuzhiyunIn order to reduce the dependency of specific fan, the measurement is
490*4882a593Smuzhiyunconducted with a digital scope without fan connected. I found out that
491*4882a593SmuzhiyunP3B-F actually output variable DC voltage on fan header center pin,
492*4882a593Smuzhiyunlooks like PWM is filtered on this motherboard.
493*4882a593Smuzhiyun
494*4882a593SmuzhiyunHere are some of measurements:
495*4882a593Smuzhiyun
496*4882a593Smuzhiyun==== =========
497*4882a593Smuzhiyun0x80     20 mV
498*4882a593Smuzhiyun0x81     20 mV
499*4882a593Smuzhiyun0x82    232 mV
500*4882a593Smuzhiyun0x83   1.2  V
501*4882a593Smuzhiyun0x84   2.31 V
502*4882a593Smuzhiyun0x85   3.44 V
503*4882a593Smuzhiyun0x86   4.62 V
504*4882a593Smuzhiyun0x87   5.81 V
505*4882a593Smuzhiyun0x88   7.01 V
506*4882a593Smuzhiyun9x89   8.22 V
507*4882a593Smuzhiyun0x8a   9.42 V
508*4882a593Smuzhiyun0x8b  10.6  V
509*4882a593Smuzhiyun0x8c  11.9  V
510*4882a593Smuzhiyun0x8d  12.4  V
511*4882a593Smuzhiyun0x8e  12.4  V
512*4882a593Smuzhiyun0x8f  12.4  V
513*4882a593Smuzhiyun==== =========
514