← Documents Documentation/hwmon/w83781d.rst GitHub 원문 ↗

Linux 6.18.37 · Hardware Monitoring

Kernel driver w83781d

W83781D 계열과 Asus 클론의 센서·경보·보정, 하위 클라이언트, PWM 실험 결과를 설명합니다.

Source pathDocumentation/hwmon/w83781d.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

w83781d.rst:1-513

W83781D 드라이버는 I2C·ISA Winbond 센서와 문서가 없는 Asus 클론을 함께 다루며, 칩별 측정 차이와 경보·프로브·PWM의 실험적 동작까지 기록합니다.

문서 개요
항목
SourceDocumentation/hwmon/w83781d.rst
분량513 source lines
지원 계열W83781D/W83782D/W83783S/AS99127F
접근I2C 및 일부 ISA
핵심 주의AS99127F는 데이터시트 없는 베타 지원

원문 분량과 핵심 기능을 요약합니다.

동작 흐름
I2C·ISA 장치 및 하위 클라이언트 탐지칩·개정·Asus 클론 판별온도·팬·전압·VID 측정과 보정경보·비프·핀 공유 상태 처리지원 가능한 sysfs 속성 제공

장치 식별부터 센서 값과 경보 제공까지의 순서입니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

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

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

지원 칩·주소·모듈 매개변수

1-65

이 드라이버는 Winbond W83781D, W83782D, W83783S와 Asus AS99127F를 지원합니다. 접두사는 각각 `w83781d`, `w83782d`, `w83783s`, `as99127f`입니다.

W83781D와 W83782D는 I2C `0x28`~`0x2f` 및 8개 I/O 포트를 쓰는 ISA `0x290`에서 검색합니다. W83783S는 I2C `0x2d`, AS99127F는 I2C `0x28`~`0x2f`에서 검색합니다. Asus 데이터시트는 제공되지 않습니다.

작성자는 Frodo Looijaard, Philip Edelbrock, Mark Studebaker입니다.

정수형 `init`의 기본값은 1입니다. 모듈을 적재할 때 컴퓨터가 충돌하면 `init=0`으로 칩 초기화를 생략해 볼 수 있습니다. 정수형 `reset`의 기본값은 0입니다. 과거 드라이버처럼 적재 시 칩을 재설정해야 한다면 `reset=1`을 사용하고 필요 사례를 보고해야 합니다.

`force_subclients=bus,caddr,saddr,saddr`는 특정 칩의 하위 클라이언트 I2C 주소를 강제합니다. 예를 들어 `force_subclients=0,0x2d,0x4a,0x4b`는 버스 0의 칩 `0x2d`에 속한 하위 클라이언트를 `0x4a`, `0x4b`로 지정합니다. 일부 Tyan 보드에서 유용합니다.

W8378 계열 지원 정보
접두사검색 주소
W83781D`w83781d`I2C `0x28`~`0x2f`, ISA `0x290`
W83782D`w83782d`I2C `0x28`~`0x2f`, ISA `0x290`
W83783S`w83783s`I2C `0x2d`
AS99127F`as99127f`I2C `0x28`~`0x2f`
`init`기본 1`init=0`이면 초기화 생략
`reset`기본 0`reset=1`이면 적재 시 재설정
`force_subclients`버스·주주소·하위주소 2개Tyan 보드 하위 클라이언트 강제

칩별 접두사와 검색 인터페이스를 정리합니다.

W8378 장치 초기화
I2C 또는 ISA 주소 검색칩 ID와 접두사 판별필요하면 초기화·재설정 옵션 적용필요하면 하위 클라이언트 주소 강제주 센서와 하위 온도 센서 등록

버스 검색부터 하위 클라이언트 구성까지의 흐름입니다.

Kernel driver w83781d
=====================

Supported chips:

  * Winbond W83781D

    Prefix: 'w83781d'

    Addresses scanned: I2C 0x28 - 0x2f, ISA 0x290 (8 I/O ports)

    Datasheet: http://www.winbond-usa.com/products/winbond_products/pdfs/PCIC/w83781d.pdf

  * Winbond W83782D

    Prefix: 'w83782d'

    Addresses scanned: I2C 0x28 - 0x2f, ISA 0x290 (8 I/O ports)

    Datasheet: https://www.winbond.com

  * Winbond W83783S

    Prefix: 'w83783s'

    Addresses scanned: I2C 0x2d

    Datasheet: http://www.winbond-usa.com/products/winbond_products/pdfs/PCIC/w83783s.pdf

  * Asus AS99127F

    Prefix: 'as99127f'

    Addresses scanned: I2C 0x28 - 0x2f

    Datasheet: Unavailable from Asus



Authors:

      - Frodo Looijaard <frodol@dds.nl>,
      - Philip Edelbrock <phil@netroedge.com>,
      - Mark Studebaker <mdsxyz123@yahoo.com>

Module parameters
-----------------

* init int
    (default 1)

    Use 'init=0' to bypass initializing the chip.
    Try this if your computer crashes when you load the module.

* reset int
    (default 0)
    The driver used to reset the chip on load, but does no more. Use
    'reset=1' to restore the old behavior. Report if you need to do this.

force_subclients=bus,caddr,saddr,saddr
  This is used to force the i2c addresses for subclients of
  a certain chip. Typical usage is `force_subclients=0,0x2d,0x4a,0x4b`
  to force the subclients of chip 0x2d on bus 0 to i2c addresses
  0x4a and 0x4b. This parameter is useful for certain Tyan boards.

칩별 센서와 측정 동작

66-150

드라이버는 네 계열을 통칭해 W8378* 칩이라고 부릅니다. 차이가 상당하지만 한 드라이버로 묶을 만큼 유사하며 Asus 칩은 I2C 전용 W83782D와 비슷합니다.

AS99127F는 전압 7개, 팬 3개, PWM 없음, 온도 3개를 가지며 개정 1과 2의 `wchipid`는 `0x31`이지만 vendor ID가 각각 `0x12c3`, `0x5ca3`입니다. W83781D는 전압 7개·팬 3개·PWM 없음·온도 3개이고 I2C와 ISA를 모두 지원합니다.

W83782D는 전압 9개, 팬 3개, PWM 2~4개, 온도 3개입니다. W83783S는 전압 5~6개, 팬 3개, PWM 2개, 온도 1~2개이며 I2C 전용입니다. 칩이 깨끗하게 접근할 수 없는 내부 상태에 있으면 자동 탐지가 실패할 수 있으므로 주소를 안다면 `force` 매개변수로 먼저 정상 상태에 넣습니다.

W83781D와 W83782D에는 온도 센서 3개, W83783S에는 2개가 있습니다. 주 온도 센서는 과열 종료값을 넘을 때 한 번 경보를 내고 히스테리시스 아래로 떨어지면 다시 경보가 발생할 수 있습니다. 히스테리시스를 +127 °C로 설정하면 실제 온도가 종료값 위에 있는 동안 계속 경보가 나며 드라이버는 초기화 때 `temp1` 히스테리시스를 127로 설정합니다.

나머지 온도 센서는 종료값을 넘으면 경보가 켜지고 히스테리시스 아래로 내려갈 때까지 유지됩니다. W83781D에서는 다른 두 센서가 경보 하나를 공유합니다. 보장 온도 범위는 -55~+125 °C이고 주 센서는 1 °C, 다른 센서는 0.5 °C 해상도입니다.

팬 속도는 RPM이고 프로그램 가능한 최저 한계 아래에서 경보가 납니다. W83781D의 팬 분주기는 1·2·4·8, 나머지는 1·2·4·8·16·32·64·128입니다. 표현할 수 없는 RPM은 반올림되며 분주기 2의 최저 표현값은 약 2600 RPM입니다.

전압 입력은 0~4.08 V를 0.016 V 해상도로 측정합니다. 최소 한계는 항상 0에 가장 가까운 값이라는 뜻이므로 음전압에서 중요합니다. VID는 프로세서가 동작해야 할 코어 전압을 인코딩하며 연결되지 않으면 흔히 3.50 V가 보입니다.

W83782D와 W83783S의 온도 변환기는 여러 프로브를 지원합니다. 센서 파일의 beta 값 1은 PII/Celeron 다이오드, 2는 TN3904 트랜지스터, 3435는 기본 서미스터입니다. 다른 값은 아직 지원하지 않습니다. CHAS 경보는 케이스가 열리면 발생하고, 컴퓨터 스피커의 비프는 전체 또는 개별 경보별로 활성화할 수 있습니다.

W8378 칩 기능 비교
vinfaninpwmtempwchipidvendor IDI2CISA
AS99127F rev.17303`0x31``0x12c3`yesno
AS99127F rev.27303`0x31``0x5ca3`yesno
W83781D7303`0x10-1``0x5ca3`yesyes
W83782D932~43`0x30``0x5ca3`yesyes
W83783S5~6321~2`0x40``0x5ca3`yesno

원문의 칩 비교 ASCII 표를 그대로 구조화했습니다.

센서 측정과 경보
칩 변형별 센서 수와 버스 구성온도·팬·전압·VID 측정분주기와 프로브 beta 적용한계 초과와 CHAS 상태 평가경보 비트 및 선택적 비프 제공

칩별 센서를 읽고 한계·경보·비프를 처리합니다.

Description
-----------

This driver implements support for the Winbond W83781D, W83782D, W83783S
chips, and the Asus AS99127F chips. We will refer to them collectively as
W8378* chips.

There is quite some difference between these chips, but they are similar
enough that it was sensible to put them together in one driver.
The Asus chips are similar to an I2C-only W83782D.

+----------+---------+--------+-------+-------+---------+--------+------+-----+
| Chip     | #vin    | #fanin | #pwm  | #temp | wchipid | vendid | i2c  | ISA |
+----------+---------+--------+-------+-------+---------+--------+------+-----+
| as99127f | 7       | 3      | 0     | 3     | 0x31    | 0x12c3 | yes  |  no |
+----------+---------+--------+-------+-------+---------+--------+------+-----+
| as99127f rev.2 (type_name = as99127f)       | 0x31    | 0x5ca3 | yes  |  no |
+----------+---------+--------+-------+-------+---------+--------+------+-----+
| w83781d  | 7       | 3      | 0     | 3     | 0x10-1  | 0x5ca3 | yes  | yes |
+----------+---------+--------+-------+-------+---------+--------+------+-----+
| w83782d  | 9       | 3      | 2-4   | 3     | 0x30    | 0x5ca3 | yes  | yes |
+----------+---------+--------+-------+-------+---------+--------+------+-----+
| w83783s  | 5-6     | 3      | 2     |  1-2  | 0x40    | 0x5ca3 | yes  |  no |
+----------+---------+--------+-------+-------+---------+--------+------+-----+

Detection of these chips can sometimes be foiled because they can be in
an internal state that allows no clean access. If you know the address
of the chip, use a 'force' parameter; this will put them into a more
well-behaved state first.

The W8378* implements temperature sensors (three on the W83781D and W83782D,
two on the W83783S), three fan rotation speed sensors, voltage sensors
(seven on the W83781D, nine on the W83782D and six on the W83783S), VID
lines, alarms with beep warnings, and some miscellaneous stuff.

Temperatures are measured in degrees Celsius. There is always one main
temperature sensor, and one (W83783S) or two (W83781D and W83782D) other
sensors. An alarm is triggered for the main sensor once when the
Overtemperature Shutdown limit is crossed; it is triggered again as soon as
it drops below the Hysteresis value. A more useful behavior
can be found by setting the Hysteresis value to +127 degrees Celsius; in
this case, alarms are issued during all the time when the actual temperature
is above the Overtemperature Shutdown value. The driver sets the
hysteresis value for temp1 to 127 at initialization.

For the other temperature sensor(s), an alarm is triggered when the
temperature gets higher then the Overtemperature Shutdown value; it stays
on until the temperature falls below the Hysteresis value. But on the
W83781D, there is only one alarm that functions for both other sensors!
Temperatures are guaranteed within a range of -55 to +125 degrees. The
main temperature sensors has a resolution of 1 degree; the other sensor(s)
of 0.5 degree.

Fan rotation speeds are reported in RPM (rotations per minute). An alarm is
triggered if the rotation speed has dropped below a programmable limit. Fan
readings can be divided by a programmable divider (1, 2, 4 or 8 for the
W83781D; 1, 2, 4, 8, 16, 32, 64 or 128 for the others) to give
the readings more range or accuracy. Not all RPM values can accurately
be represented, so some rounding is done. With a divider of 2, the lowest
representable value is around 2600 RPM.

Voltage sensors (also known as IN sensors) report their values in volts.
An alarm is triggered if the voltage has crossed a programmable minimum
or maximum limit. Note that minimum in this case always means 'closest to
zero'; this is important for negative voltage measurements. All voltage
inputs can measure voltages between 0 and 4.08 volts, with a resolution
of 0.016 volt.

The VID lines encode the core voltage value: the voltage level your processor
should work with. This is hardcoded by the mainboard and/or processor itself.
It is a value in volts. When it is unconnected, you will often find the
value 3.50 V here.

The W83782D and W83783S temperature conversion machine understands about
several kinds of temperature probes. You can program the so-called
beta value in the sensor files. '1' is the PII/Celeron diode, '2' is the
TN3904 transistor, and 3435 the default thermistor value. Other values
are (not yet) supported.

In addition to the alarms described above, there is a CHAS alarm on the
chips which triggers if your computer case is open.

When an alarm goes off, you can be warned by a beeping signal through
your computer speaker. It is possible to enable all beeping globally,
or only the beeping for some alarms.

경보 비트·AS99127F 문제·핀 공유

151-228

개별 alarm·beep 비트는 `0x000001`부터 `0x020000`까지 전압, 온도, 팬, 섀시 상태에 대응합니다. W83781D에서는 `0x000020`이 `temp2`와 `temp3`을 함께 나타내며 W83782D 전용 `temp3`, `in7`, `in8` 비트도 따로 있습니다.

경보가 발생하면 하드웨어 레지스터를 한 번 이상 읽을 때까지 유지되므로 읽을 때 원인이 이미 사라졌을 수 있습니다. 현재 구현은 마지막 갱신 후 1.5초 미만인 경우를 제외하고 어떤 데이터든 읽을 때 모든 레지스터를 읽으므로 일회성 경보를 놓치기 쉽습니다. 칩 값도 1.5초마다 갱신되므로 더 자주 읽으면 이전 값을 반환합니다.

AS99127F 지원은 데이터시트 없이 개발됐습니다. 대부분 W83781D처럼 취급하지만 개정 2는 W83782D에 더 가깝고, 데이터시트가 나올 때까지 베타입니다. 팬이 가끔 멈춘다는 보고가 있습니다.

AS99127F의 개별 비프 비트는 다른 칩과 반대지만 드라이버가 뒤집어 사용자 공간에서 차이를 알 필요가 없습니다. 알려진 문제는 다이오드·서미스터 설정의 불확실성, 높은 서버 부하에서 팬 정지, 개정 2의 PWM 레지스터 2개 처리 방법 미상입니다. 데이터시트 없이는 고칠 수 없으며 개발자에게 추가 지원이나 Asus 설득 방법을 문의하지 말 것을 요청합니다.

W83783S에는 `in1`이 없고 `in[2-6]`을 781D/782D와 호환되게 유지합니다. -5 V 또는 `temp1`으로 쓸 수 있는 핀은 기본이 -5 V이고 드라이버 제어가 없어 `temp1`이 동작하지 않습니다.

782D와 783S 데이터시트의 pwm1·pwm2 정의가 서로 달라 드라이버는 782D를 따릅니다. fan3 입력과 pwm2 출력이 핀을 공유하고 기본값은 fan3입니다. `echo 255 1 > pwm2`로 pwm2를 활성화하면 fan3은 0을 보고합니다. 782D는 ISA에서 pwm1~2, I2C에서 pwm1~4를 제공하며 pwm3~4는 ISA 핀과 공유합니다.

W8378 경보·비프 비트
비트대상
`0x000001``in0`
`0x000002``in1`
`0x000004``in2`
`0x000008``in3`
`0x000010``temp1`
`0x000020``temp2` (+ W83781D의 `temp3`)
`0x000040``fan1`
`0x000080``fan2`
`0x000100``in4`
`0x000200``in5`
`0x000400``in6`
`0x000800``fan3`
`0x001000`chassis
`0x002000``temp3` (W83782D 전용)
`0x010000``in7` (W83782D 전용)
`0x020000``in8` (W83782D 전용)

원문의 16개 비트 매핑을 보존했습니다.

경보 읽기와 핀 공유 영향
1.5초 주기로 센서·경보 레지스터 갱신경보 비트를 센서별 속성으로 해석읽기 동작으로 래치된 경보 해제PWM2 활성 시 공유 fan3 입력 비활성사용자 공간에 캐시 값과 보정된 비프 상태 제공

레지스터 일괄 읽기와 PWM 활성화가 상태에 미치는 흐름입니다.


Individual alarm and beep bits:

======== ==========================
0x000001 in0
0x000002 in1
0x000004 in2
0x000008 in3
0x000010 temp1
0x000020 temp2 (+temp3 on W83781D)
0x000040 fan1
0x000080 fan2
0x000100 in4
0x000200 in5
0x000400 in6
0x000800 fan3
0x001000 chassis
0x002000 temp3 (W83782D only)
0x010000 in7 (W83782D only)
0x020000 in8 (W83782D only)
======== ==========================

If an alarm triggers, it will remain triggered until the hardware register
is read at least once. This means that the cause for the alarm may
already have disappeared! Note that in the current implementation, all
hardware registers are read whenever any data is read (unless it is less
than 1.5 seconds since the last update). This means that you can easily
miss once-only alarms.

The chips only update values each 1.5 seconds; reading them more often
will do no harm, but will return 'old' values.

AS99127F PROBLEMS
-----------------
The as99127f support was developed without the benefit of a datasheet.
In most cases it is treated as a w83781d (although revision 2 of the
AS99127F looks more like a w83782d).
This support will be BETA until a datasheet is released.
One user has reported problems with fans stopping
occasionally.

Note that the individual beep bits are inverted from the other chips.
The driver now takes care of this so that user-space applications
don't have to know about it.

Known problems:
        - Problems with diode/thermistor settings (supported?)
        - One user reports fans stopping under high server load.
        - Revision 2 seems to have 2 PWM registers but we don't know
          how to handle them. More details below.

These will not be fixed unless we get a datasheet.
If you have problems, please lobby Asus to release a datasheet.
Unfortunately several others have without success.
Please do not send mail to us asking for better as99127f support.
We have done the best we can without a datasheet.
Please do not send mail to the author or the sensors group asking for
a datasheet or ideas on how to convince Asus. We can't help.


NOTES
-----
  783s has no in1 so that in[2-6] are compatible with the 781d/782d.

  783s pin is programmable for -5V or temp1; defaults to -5V,
  no control in driver so temp1 doesn't work.

  782d and 783s datasheets differ on which is pwm1 and which is pwm2.
  We chose to follow 782d.

  782d and 783s pin is programmable for fan3 input or pwm2 output;
  defaults to fan3 input.
  If pwm2 is enabled (with echo 255 1 > pwm2), then
  fan3 will report 0.

  782d has pwm1-2 for ISA, pwm1-4 for i2c. (pwm3-4 share pins with
  the ISA pins)

PWM 클록과 Winbond 기술 지원 답변

229-280

데이터시트 갱신 정보에 따르면 PWM 클록 선택값 `000`, `001`, `010`, `011`, `100`은 각각 master 클록을 512, 1024, 2048, 4096, 8192로 나눈 값입니다.

W83781D 데이터시트는 beta가 3435 K가 아닌 서미스터에 맞춰 R-T 표를 다시 프로그램할 수 있다고 설명하지만 계산식은 기밀입니다. Winbond는 사용자가 서미스터 공급자에게서 실제 R-T 표를 받아 제공하면 32바이트 데이터를 계산해 줄 수 있고, 이 데이터는 W83781D의 `Bank0.CR51`에 기록합니다.

W83782D의 핀 38·39·40을 서미스터 또는 Pentium II 다이오드 입력으로 바꾸려면 Bank0의 `CR[5Dh]`와 `CR[59h]`를 설정합니다. `CR[5Dh]`의 VTIN1/2/3 비트 1·2·3은 0이면 서미스터, 1이면 다이오드입니다.

`CR[59h]`의 올바른 VTIN1/2/3 비트는 4·5·6입니다. 데이터시트에 VTIN2를 비트 2로 적은 표기는 오류입니다. 이 세 비트가 1이면 PII 열 다이오드, 0이면 2N3904 다이오드입니다.

W8378 클록·온도 프로브 설정
영역설정의미
PWM clock`000`master / 512
PWM clock`001`master / 1024
PWM clock`010`master / 2048
PWM clock`011`master / 4096
PWM clock`100`master / 8192
`CR[5Dh]` VTIN1/2/3비트 1/2/3 = 0thermistor
`CR[5Dh]` VTIN1/2/3비트 1/2/3 = 1diode
`CR[59h]` VTIN1/2/3비트 4/5/6 = 1PII thermal diode
`CR[59h]` VTIN1/2/3비트 4/5/6 = 02N3904 diode

PWM 분주값과 VTIN 레지스터 비트 표를 한 구조로 정리했습니다.

비표준 서미스터·다이오드 구성
서미스터 beta와 실제 R-T 표 확보필요하면 Winbond에서 32바이트 표 계산`Bank0.CR51`에 R-T 데이터 기록`CR[5Dh]`에서 thermistor/diode 선택`CR[59h]`에서 PII/2N3904 선택

실제 프로브 종류에 맞춰 테이블과 레지스터를 설정합니다.

Data sheet updates
------------------
        - PWM clock registers:
                * 000: master /  512
                * 001: master / 1024
                * 010: master / 2048
                * 011: master / 4096
                * 100: master / 8192


Answers from Winbond tech support
---------------------------------

::

  >
  > 1) In the W83781D data sheet section 7.2 last paragraph, it talks about
  >    reprogramming the R-T table if the Beta of the thermistor is not
  >    3435K. The R-T table is described briefly in section 8.20.
  >    What formulas do I use to program a new R-T table for a given Beta?
  >

  We are sorry that the calculation for R-T table value is
  confidential. If you have another Beta value of thermistor, we can help
  to calculate the R-T table for you. But you should give us real R-T
  Table which can be gotten by thermistor vendor. Therefore we will calculate
  them and obtain 32-byte data, and you can fill the 32-byte data to the
  register in Bank0.CR51 of W83781D.


  > 2) In the W83782D data sheet, it mentions that pins 38, 39, and 40 are
  >    programmable to be either thermistor or Pentium II diode inputs.
  >    How do I program them for diode inputs? I can't find any register
  >    to program these to be diode inputs.

  You may program Bank0 CR[5Dh] and CR[59h] registers.

  =============================== =============== ============== ============
        CR[5Dh]                    bit 1(VTIN1)    bit 2(VTIN2)   bit 3(VTIN3)

                thermistor                0                 0                0
        diode                           1                 1                1


  (error) CR[59h]                 bit 4(VTIN1)        bit 2(VTIN2)   bit 3(VTIN3)
  (right) CR[59h]                 bit 4(VTIN1)        bit 5(VTIN2)   bit 6(VTIN3)

        PII thermal diode         1                 1                1
        2N3904        diode                  0                 0                0
  =============================== =============== ============== ============

Asus 클론 식별과 온도 센서

281-347

AS99127F와 ASB100 Bach Asus 클론의 데이터시트는 없습니다. 이 절은 Alex Van Kaam이 제공한 탐지·값 읽기 정보와 아직 지원하지 않는 Mozart-2 조언을 바탕으로 하며 일부 문장은 편집자의 의견을 포함합니다.

AS99127F 개정 1·2와 ASB100의 I2C 주소 범위는 `0x29`~`0x2f`입니다. 레지스터 `0x58`이 `0x31`이면 Asus 칩이며 `0x4f` 제조사 ID가 `0x06` 또는 `0x94`면 ASB100, `0x12` 또는 `0xc3`면 AS99127F rev.1, `0x5c` 또는 `0xa3`면 rev.2입니다.

`0x5ca3`은 Winbond의 ID여서 AS99127F rev.2가 Winbond에서 직접 공급됐을 가능성을 시사합니다. 다른 코드는 ATT와 DVC를 뜻할 수 있지만 단순 해석용 코드가 아닐 수도 있습니다.

Mozart-2의 I2C 주소는 `0x77`이고 `0x58`이 `0x56` 또는 `0x10`이면 Mozart-2입니다. `0x58=0x56, 0x4e=0x94, 0x4f=0x36`은 ASM58, 마지막이 `0x06`이면 AS2K129R, `0x58=0x10, 0x4e=0x5c, 0x4f=0xa3`은 이름 미상의 Asus Mozart-2입니다. 세 종류는 같은 방식으로 다룰 수 있습니다.

ASB100의 sensor1은 `0x27`, sensor2·3은 SMBus의 LM75 두 개, sensor4는 `0x17`입니다. Intel 보드는 sensor2를 CPU에 사용하고 sensor4는 무시되거나 고정되는 반면 AMD 보드는 sensor4를 CPU에 사용하고 sensor2는 무시되거나 소켓 온도일 수 있습니다.

AS99127F 개정 1·2의 sensor1은 `0x27`, sensor2·3은 LM75입니다. `0x5b`가 온도 유형 선택기로 추정되며 비트 1·3·5가 temp1·2·3을 제어할 수 있습니다. Mozart-2의 sensor1은 `0x27`, sensor2는 `0x13`입니다.

Asus 클론 식별·온도 매핑
장치식별온도 센서
ASB100`0x58=0x31`, `0x4f=0x06/0x94``0x27`, LM75 2개, `0x17`
AS99127F rev.1`0x58=0x31`, `0x4f=0x12/0xc3``0x27`, LM75 2개
AS99127F rev.2`0x58=0x31`, `0x4f=0x5c/0xa3``0x27`, LM75 2개
ASM58 Mozart-2`0x58=0x56`, `0x4e=0x94`, `0x4f=0x36``0x27`, `0x13`
AS2K129R Mozart-2`0x58=0x56`, `0x4e=0x94`, `0x4f=0x06``0x27`, `0x13`
미상 Mozart-2`0x58=0x10`, `0x4e=0x5c`, `0x4f=0xa3``0x27`, `0x13`

주소와 ID 조합 및 온도 레지스터를 구조화했습니다.

Asus 클론 판별
대상 I2C 주소 범위 검색`0x58` 칩 ID 확인`0x4e/0x4f` 제조사 ID 조합 확인ASB100·AS99127F·Mozart-2 판별장치별 내부·LM75 온도 채널 연결

공통 칩 ID 뒤 제조사 ID와 온도 레지스터를 해석합니다.

Asus Clones
-----------

We have no datasheets for the Asus clones (AS99127F and ASB100 Bach).
Here are some very useful information that were given to us by Alex Van
Kaam about how to detect these chips, and how to read their values. He
also gives advice for another Asus chipset, the Mozart-2 (which we
don't support yet). Thanks Alex!

I reworded some parts and added personal comments.

Detection
^^^^^^^^^

AS99127F rev.1, AS99127F rev.2 and ASB100:
- I2C address range: 0x29 - 0x2F
- If register 0x58 holds 0x31 then we have an Asus (either ASB100 or AS99127F)
- Which one depends on register 0x4F (manufacturer ID):

  - 0x06 or 0x94: ASB100
  - 0x12 or 0xC3: AS99127F rev.1
  - 0x5C or 0xA3: AS99127F rev.2

  Note that 0x5CA3 is Winbond's ID (WEC), which let us think Asus get their
  AS99127F rev.2 direct from Winbond. The other codes mean ATT and DVC,
  respectively. ATT could stand for Asustek something (although it would be
  very badly chosen IMHO), I don't know what DVC could stand for. Maybe
  these codes simply aren't meant to be decoded that way.

Mozart-2:
- I2C address: 0x77
- If register 0x58 holds 0x56 or 0x10 then we have a Mozart-2
- Of the Mozart there are 3 types:

  - 0x58=0x56, 0x4E=0x94, 0x4F=0x36: Asus ASM58 Mozart-2
  - 0x58=0x56, 0x4E=0x94, 0x4F=0x06: Asus AS2K129R Mozart-2
  - 0x58=0x10, 0x4E=0x5C, 0x4F=0xA3: Asus ??? Mozart-2

  You can handle all 3 the exact same way :)

Temperature sensors
^^^^^^^^^^^^^^^^^^^

ASB100:
  - sensor 1: register 0x27
  - sensor 2 & 3 are the 2 LM75's on the SMBus
  - sensor 4: register 0x17

Remark:

  I noticed that on Intel boards sensor 2 is used for the CPU
  and 4 is ignored/stuck, on AMD boards sensor 4 is the CPU and sensor 2 is
  either ignored or a socket temperature.

AS99127F (rev.1 and 2 alike):
  - sensor 1: register 0x27
  - sensor 2 & 3 are the 2 LM75's on the SMBus

Remark:

  Register 0x5b is suspected to be temperature type selector. Bit 1
  would control temp1, bit 3 temp2 and bit 5 temp3.

Mozart-2:
  - sensor 1: register 0x27
  - sensor 2: register 0x13

Asus 클론 팬과 전압 공식

348-405

ASB100과 AS99127F 개정 1·2는 W83781D와 같은 팬 센서 3개를 가집니다. Mozart-2는 팬 2개뿐이며 식은 `1350000/RPM/div`입니다. fan1 값은 `0x28`, 분주기는 `0xa1` 비트 4~5이고 fan2 값은 `0x29`, 분주기는 비트 6~7입니다.

전압 공식은 AS99127F 개정 1과 2의 주요 차이이며 W83781D와 W83782D의 차이와 비슷합니다. ASB100과 AS99127F rev.1은 `in0`~`in4`가 같은 공식을 쓰지만 음전압 `in5`, `in6`의 마지막 배율이 ASB100은 3.97·1.666, rev.1은 3.97·1.503입니다.

AS99127F rev.2는 `in0`~`in4`가 같고 `in5=(r(0x25)*0.016-3.6)*5.14+3.6`, `in6=(r(0x26)*0.016-3.6)*3.14+3.6`을 사용합니다. Mozart-2는 `in1`, `in5`, `in6`을 255로 두고 `in4` 배율은 4입니다.

Asus 클론 전압 환산식
장치채널공식
ASB100`in0``r(0x20)*0.016`
ASB100`in1``r(0x21)*0.016`
ASB100`in2``r(0x22)*0.016`
ASB100`in3``r(0x23)*0.016*1.68`
ASB100`in4``r(0x24)*0.016*3.8`
ASB100`in5``r(0x25)*(-0.016)*3.97`
ASB100`in6``r(0x26)*(-0.016)*1.666`
AS99127F rev.1`in0`~`in4`ASB100과 동일
AS99127F rev.1`in5``r(0x25)*(-0.016)*3.97`
AS99127F rev.1`in6``r(0x26)*(-0.016)*1.503`
AS99127F rev.2`in0`~`in4`ASB100과 동일
AS99127F rev.2`in5``(r(0x25)*0.016-3.6)*5.14+3.6`
AS99127F rev.2`in6``(r(0x26)*0.016-3.6)*3.14+3.6`
Mozart-2`in0``r(0x20)*0.016`
Mozart-2`in1``255`
Mozart-2`in2``r(0x22)*0.016`
Mozart-2`in3``r(0x23)*0.016*1.68`
Mozart-2`in4``r(0x24)*0.016*4`
Mozart-2`in5`, `in6``255`

원문에 제시된 모든 장치·채널 공식을 보존했습니다.

Asus 측정값 환산
ASB100·AS99127F 개정·Mozart-2 판별팬 레지스터와 분주기 읽기전압 채널 레지스터 읽기장치·채널별 배율 또는 오프셋 공식 적용실제 RPM·전압 값 제공

칩 개정과 채널에 맞는 팬·전압 공식을 선택합니다.

Fan sensors
^^^^^^^^^^^

ASB100, AS99127F (rev.1 and 2 alike):
  - 3 fans, identical to the W83781D

Mozart-2:
  - 2 fans only, 1350000/RPM/div
  - fan 1: register 0x28,  divisor on register 0xA1 (bits 4-5)
  - fan 2: register 0x29,  divisor on register 0xA1 (bits 6-7)

Voltages
^^^^^^^^

This is where there is a difference between AS99127F rev.1 and 2.

Remark:

  The difference is similar to the difference between
  W83781D and W83782D.

ASB100:
  - in0=r(0x20)*0.016
  - in1=r(0x21)*0.016
  - in2=r(0x22)*0.016
  - in3=r(0x23)*0.016*1.68
  - in4=r(0x24)*0.016*3.8
  - in5=r(0x25)*(-0.016)*3.97
  - in6=r(0x26)*(-0.016)*1.666

AS99127F rev.1:
  - in0=r(0x20)*0.016
  - in1=r(0x21)*0.016
  - in2=r(0x22)*0.016
  - in3=r(0x23)*0.016*1.68
  - in4=r(0x24)*0.016*3.8
  - in5=r(0x25)*(-0.016)*3.97
  - in6=r(0x26)*(-0.016)*1.503

AS99127F rev.2:
  - in0=r(0x20)*0.016
  - in1=r(0x21)*0.016
  - in2=r(0x22)*0.016
  - in3=r(0x23)*0.016*1.68
  - in4=r(0x24)*0.016*3.8
  - in5=(r(0x25)*0.016-3.6)*5.14+3.6
  - in6=(r(0x26)*0.016-3.6)*3.14+3.6

Mozart-2:
  - in0=r(0x20)*0.016
  - in1=255
  - in2=r(0x22)*0.016
  - in3=r(0x23)*0.016*1.68
  - in4=r(0x24)*0.016*4
  - in5=255
  - in6=255

AS99127F PWM 레지스터 추정 동작

406-451

2004년 4월 9일 기준 Jean Delvare의 추가 정보에 따르면 AS99127F rev.2에는 PWM 레지스터 `0x59`, `0x5a`와 온도 센서 유형 선택기 `0x5b`가 있는 것으로 보입니다. Winbond 칩과 비교하면 `0x59`와 `0x5b`가 바뀐 셈입니다. rev.1에도 유형 선택기 `0x5b`가 있지만 PWM 레지스터는 효과가 없는 것으로 알려졌습니다.

온도 센서 유형 선택 방식은 정확히 알려지지 않았습니다. temp1은 비트 1~0, temp2는 3~2, temp3은 5~4로 보이지만 각 쌍의 상위 비트만 중요할 수도 있습니다. 지금까지 0이 아닌 값은 측정값을 망가뜨렸습니다.

PWM 레지스터의 비트 7은 모드 선택기이고 나머지는 값 또는 임계값으로 보입니다. 비트 7이 0이면 비트 6~0 값이 어떤 한계보다 낮을 때 저속, 높을 때 전속입니다. 한계의 의미는 알 수 없고 속도 변화가 늦게 나타나는 관성과 증가·감소 방향에 따라 한계가 달라지는 히스테리시스가 의심됩니다.

비트 7이 1이면 비트 3~0이 임계값이고 비트 6~4는 중요하지 않은 것으로 보입니다. 값이 한계보다 낮으면 전속, 높으면 저속으로 앞 모드와 반대지만 이 한계의 의미도 모릅니다.

전환 상태를 빼면 팬 속도는 일반적인 PWM처럼 연속 범위가 아니라 두세 단계뿐입니다. `0x00` 또는 `0x8f`를 쓰면 저속, `0x7f` 또는 `0x80`을 쓰면 전속으로 돌릴 수 있습니다. 정확한 동작이 알려질 때까지 w83781d 드라이버는 AS99127F PWM을 전혀 처리하지 않습니다.

AS99127F PWM 추정 모델
조건/값추정 의미관찰 결과
bit 7 = 0bits 6~0 임계값낮으면 저속, 높으면 전속
bit 7 = 1bits 3~0 임계값낮으면 전속, 높으면 저속
`0x00`bit 7 clear 최저값저속
`0x8f`bit 7 set 최대 하위값저속
`0x7f`bit 7 clear 최대값전속
`0x80`bit 7 set 최저 하위값전속
속도 범위2~3개 단계관성·히스테리시스 의심

레지스터 비트와 관찰된 저속·전속 동작을 정리합니다.

알려지지 않은 PWM 동작 추론
`0x59/0x5a` PWM 레지스터 식별bit 7 모드와 하위 비트 분리값을 증가·감소시키며 속도 관찰관성·히스테리시스와 단계 수 추정안전한 드라이버 지원은 보류

레지스터 값을 바꾸고 속도 반응을 관찰한 과정입니다.

PWM
^^^

* Additional info about PWM on the AS99127F (may apply to other Asus
  chips as well) by Jean Delvare as of 2004-04-09:

AS99127F revision 2 seems to have two PWM registers at 0x59 and 0x5A,
and a temperature sensor type selector at 0x5B (which basically means
that they swapped registers 0x59 and 0x5B when you compare with Winbond
chips).
Revision 1 of the chip also has the temperature sensor type selector at
0x5B, but PWM registers have no effect.

We don't know exactly how the temperature sensor type selection works.
Looks like bits 1-0 are for temp1, bits 3-2 for temp2 and bits 5-4 for
temp3, although it is possible that only the most significant bit matters
each time. So far, values other than 0 always broke the readings.

PWM registers seem to be split in two parts: bit 7 is a mode selector,
while the other bits seem to define a value or threshold.

When bit 7 is clear, bits 6-0 seem to hold a threshold value. If the value
is below a given limit, the fan runs at low speed. If the value is above
the limit, the fan runs at full speed. We have no clue as to what the limit
represents. Note that there seem to be some inertia in this mode, speed
changes may need some time to trigger. Also, an hysteresis mechanism is
suspected since walking through all the values increasingly and then
decreasingly led to slightly different limits.

When bit 7 is set, bits 3-0 seem to hold a threshold value, while bits 6-4
would not be significant. If the value is below a given limit, the fan runs
at full speed, while if it is above the limit it runs at low speed (so this
is the contrary of the other mode, in a way). Here again, we don't know
what the limit is supposed to represent.

One remarkable thing is that the fans would only have two or three
different speeds (transitional states left apart), not a whole range as
you usually get with PWM.

As a conclusion, you can write 0x00 or 0x8F to the PWM registers to make
fans run at low speed, and 0x7F or 0x80 to make them run at full speed.

Please contact us if you can figure out how it is supposed to work. As
long as we don't know more, the w83781d driver doesn't handle PWM on
AS99127F chips at all.

AS99127F rev.1 PWM 실험

452-513

Hector Martin의 AS99127F rev.1 실험에서는 `0x59`의 `0x80`~`0x8f` 값이 거친 PWM처럼 동작했습니다. `0x80`은 1~2분 후 팬을 끄는 듯해 온도 기반 자동 제어일 가능성이 있고, `0x81`은 꺼짐, `0x82`는 모터가 움직이지 못할 정도의 매우 낮은 PWM, `0x83`은 약 70% 속도, `0x84`~`0x8f`는 전속으로 관찰됐습니다.

상위 니블은 최상위 비트 외에는 큰 영향이 없었고 PWM이 동작하려면 `0x80` 비트가 켜져야 했습니다. ASUS A7V266-E에서 Windows speedfan과 비슷하게 0~15%는 꺼짐, 그보다 조금 높은 구간은 70%, 이후는 전속으로 동작했습니다.

lm-sensors 티켓 #2350의 Asus P3B-F AS99127F rev.1 실험은 `0x59`가 CPU_Fan 헤더, `0x5a`가 PWR_Fan을 제어함을 확인했습니다. 팬 의존성을 줄이려고 팬 없이 디지털 오실로스코프로 측정했으며, 가운데 핀에서 가변 DC 전압이 나와 보드에서 PWM이 필터링되는 것으로 보였습니다.

실측 전압은 `0x80`, `0x81`에서 20 mV로 시작해 `0x82` 232 mV, `0x83` 1.2 V, 이후 단계적으로 증가해 `0x8d`~`0x8f`에서 12.4 V였습니다. 원문 표의 `9x89` 표기는 그대로 보존했으며 의미상 `0x89` 단계로 해석됩니다.

AS99127F rev.1 PWM 실측
레지스터 값전압
`0x80`20 mV
`0x81`20 mV
`0x82`232 mV
`0x83`1.2 V
`0x84`2.31 V
`0x85`3.44 V
`0x86`4.62 V
`0x87`5.81 V
`0x88`7.01 V
`9x89` (원문 표기)8.22 V
`0x8a`9.42 V
`0x8b`10.6 V
`0x8c`11.9 V
`0x8d`12.4 V
`0x8e`12.4 V
`0x8f`12.4 V

P3B-F 팬 헤더 중앙 핀의 원문 측정표를 보존했습니다.

PWM 헤더 실측
`0x59` CPU_Fan·`0x5a` PWR_Fan 대응 확인팬을 분리하고 디지털 스코프 연결`0x80`부터 `0x8f`까지 값 기록가운데 핀 DC 전압 측정보드의 PWM 필터링과 단계형 제어 추론

레지스터 단계별 출력 전압을 팬 없이 측정한 절차입니다.

* Additional info about PWM on the AS99127F rev.1 by Hector Martin:

I've been fiddling around with the (in)famous 0x59 register and
found out the following values do work as a form of coarse pwm:

0x80
 - seems to turn fans off after some time(1-2 minutes)... might be
   some form of auto-fan-control based on temp? hmm (Qfan? this mobo is an
   old ASUS, it isn't marketed as Qfan. Maybe some beta pre-attempt at Qfan
   that was dropped at the BIOS)
0x81
 - off
0x82
 - slightly "on-ner" than off, but my fans do not get to move. I can
   hear the high-pitched PWM sound that motors give off at too-low-pwm.
0x83
 - now they do move. Estimate about 70% speed or so.
0x84-0x8f
 - full on

Changing the high nibble doesn't seem to do much except the high bit
(0x80) must be set for PWM to work, else the current pwm doesn't seem to
change.

My mobo is an ASUS A7V266-E. This behavior is similar to what I got
with speedfan under Windows, where 0-15% would be off, 15-2x% (can't
remember the exact value) would be 70% and higher would be full on.

* Additional info about PWM on the AS99127F rev.1 from lm-sensors
  ticket #2350:

I conducted some experiment on Asus P3B-F motherboard with AS99127F
(Ver. 1).

I confirm that 0x59 register control the CPU_Fan Header on this
motherboard, and 0x5a register control PWR_Fan.

In order to reduce the dependency of specific fan, the measurement is
conducted with a digital scope without fan connected. I found out that
P3B-F actually output variable DC voltage on fan header center pin,
looks like PWM is filtered on this motherboard.

Here are some of measurements:

==== =========
0x80     20 mV
0x81     20 mV
0x82    232 mV
0x83   1.2  V
0x84   2.31 V
0x85   3.44 V
0x86   4.62 V
0x87   5.81 V
0x88   7.01 V
9x89   8.22 V
0x8a   9.42 V
0x8b  10.6  V
0x8c  11.9  V
0x8d  12.4  V
0x8e  12.4  V
0x8f  12.4  V
==== =========