xref: /openbmc/linux/Documentation/hwmon/w83781d.rst (revision 4b4193256c8d3bc3a5397b5cd9494c2ad386317d)
17ebd8b66SMauro Carvalho ChehabKernel driver w83781d
27ebd8b66SMauro Carvalho Chehab=====================
37ebd8b66SMauro Carvalho Chehab
47ebd8b66SMauro Carvalho ChehabSupported chips:
57ebd8b66SMauro Carvalho Chehab
67ebd8b66SMauro Carvalho Chehab  * Winbond W83781D
77ebd8b66SMauro Carvalho Chehab
87ebd8b66SMauro Carvalho Chehab    Prefix: 'w83781d'
97ebd8b66SMauro Carvalho Chehab
107ebd8b66SMauro Carvalho Chehab    Addresses scanned: I2C 0x28 - 0x2f, ISA 0x290 (8 I/O ports)
117ebd8b66SMauro Carvalho Chehab
127ebd8b66SMauro Carvalho Chehab    Datasheet: http://www.winbond-usa.com/products/winbond_products/pdfs/PCIC/w83781d.pdf
137ebd8b66SMauro Carvalho Chehab
147ebd8b66SMauro Carvalho Chehab  * Winbond W83782D
157ebd8b66SMauro Carvalho Chehab
167ebd8b66SMauro Carvalho Chehab    Prefix: 'w83782d'
177ebd8b66SMauro Carvalho Chehab
187ebd8b66SMauro Carvalho Chehab    Addresses scanned: I2C 0x28 - 0x2f, ISA 0x290 (8 I/O ports)
197ebd8b66SMauro Carvalho Chehab
20*ad736c1aSAlexander A. Klimov    Datasheet: https://www.winbond.com
217ebd8b66SMauro Carvalho Chehab
227ebd8b66SMauro Carvalho Chehab  * Winbond W83783S
237ebd8b66SMauro Carvalho Chehab
247ebd8b66SMauro Carvalho Chehab    Prefix: 'w83783s'
257ebd8b66SMauro Carvalho Chehab
267ebd8b66SMauro Carvalho Chehab    Addresses scanned: I2C 0x2d
277ebd8b66SMauro Carvalho Chehab
287ebd8b66SMauro Carvalho Chehab    Datasheet: http://www.winbond-usa.com/products/winbond_products/pdfs/PCIC/w83783s.pdf
297ebd8b66SMauro Carvalho Chehab
307ebd8b66SMauro Carvalho Chehab  * Asus AS99127F
317ebd8b66SMauro Carvalho Chehab
327ebd8b66SMauro Carvalho Chehab    Prefix: 'as99127f'
337ebd8b66SMauro Carvalho Chehab
347ebd8b66SMauro Carvalho Chehab    Addresses scanned: I2C 0x28 - 0x2f
357ebd8b66SMauro Carvalho Chehab
367ebd8b66SMauro Carvalho Chehab    Datasheet: Unavailable from Asus
377ebd8b66SMauro Carvalho Chehab
387ebd8b66SMauro Carvalho Chehab
397ebd8b66SMauro Carvalho Chehab
407ebd8b66SMauro Carvalho ChehabAuthors:
417ebd8b66SMauro Carvalho Chehab
427ebd8b66SMauro Carvalho Chehab      - Frodo Looijaard <frodol@dds.nl>,
437ebd8b66SMauro Carvalho Chehab      - Philip Edelbrock <phil@netroedge.com>,
447ebd8b66SMauro Carvalho Chehab      - Mark Studebaker <mdsxyz123@yahoo.com>
457ebd8b66SMauro Carvalho Chehab
467ebd8b66SMauro Carvalho ChehabModule parameters
477ebd8b66SMauro Carvalho Chehab-----------------
487ebd8b66SMauro Carvalho Chehab
497ebd8b66SMauro Carvalho Chehab* init int
507ebd8b66SMauro Carvalho Chehab    (default 1)
517ebd8b66SMauro Carvalho Chehab
527ebd8b66SMauro Carvalho Chehab    Use 'init=0' to bypass initializing the chip.
537ebd8b66SMauro Carvalho Chehab    Try this if your computer crashes when you load the module.
547ebd8b66SMauro Carvalho Chehab
557ebd8b66SMauro Carvalho Chehab* reset int
567ebd8b66SMauro Carvalho Chehab    (default 0)
577ebd8b66SMauro Carvalho Chehab    The driver used to reset the chip on load, but does no more. Use
587ebd8b66SMauro Carvalho Chehab    'reset=1' to restore the old behavior. Report if you need to do this.
597ebd8b66SMauro Carvalho Chehab
607ebd8b66SMauro Carvalho Chehabforce_subclients=bus,caddr,saddr,saddr
617ebd8b66SMauro Carvalho Chehab  This is used to force the i2c addresses for subclients of
627ebd8b66SMauro Carvalho Chehab  a certain chip. Typical usage is `force_subclients=0,0x2d,0x4a,0x4b`
637ebd8b66SMauro Carvalho Chehab  to force the subclients of chip 0x2d on bus 0 to i2c addresses
647ebd8b66SMauro Carvalho Chehab  0x4a and 0x4b. This parameter is useful for certain Tyan boards.
657ebd8b66SMauro Carvalho Chehab
667ebd8b66SMauro Carvalho ChehabDescription
677ebd8b66SMauro Carvalho Chehab-----------
687ebd8b66SMauro Carvalho Chehab
697ebd8b66SMauro Carvalho ChehabThis driver implements support for the Winbond W83781D, W83782D, W83783S
707ebd8b66SMauro Carvalho Chehabchips, and the Asus AS99127F chips. We will refer to them collectively as
717ebd8b66SMauro Carvalho ChehabW8378* chips.
727ebd8b66SMauro Carvalho Chehab
737ebd8b66SMauro Carvalho ChehabThere is quite some difference between these chips, but they are similar
747ebd8b66SMauro Carvalho Chehabenough that it was sensible to put them together in one driver.
757ebd8b66SMauro Carvalho ChehabThe Asus chips are similar to an I2C-only W83782D.
767ebd8b66SMauro Carvalho Chehab
777ebd8b66SMauro Carvalho Chehab+----------+---------+--------+-------+-------+---------+--------+------+-----+
787ebd8b66SMauro Carvalho Chehab| Chip     | #vin    | #fanin | #pwm  | #temp | wchipid | vendid | i2c  | ISA |
797ebd8b66SMauro Carvalho Chehab+----------+---------+--------+-------+-------+---------+--------+------+-----+
807ebd8b66SMauro Carvalho Chehab| as99127f | 7       | 3      | 0     | 3     | 0x31    | 0x12c3 | yes  |  no |
817ebd8b66SMauro Carvalho Chehab+----------+---------+--------+-------+-------+---------+--------+------+-----+
827ebd8b66SMauro Carvalho Chehab| as99127f rev.2 (type_name = as99127f)       | 0x31    | 0x5ca3 | yes  |  no |
837ebd8b66SMauro Carvalho Chehab+----------+---------+--------+-------+-------+---------+--------+------+-----+
847ebd8b66SMauro Carvalho Chehab| w83781d  | 7       | 3      | 0     | 3     | 0x10-1  | 0x5ca3 | yes  | yes |
857ebd8b66SMauro Carvalho Chehab+----------+---------+--------+-------+-------+---------+--------+------+-----+
867ebd8b66SMauro Carvalho Chehab| w83782d  | 9       | 3      | 2-4   | 3     | 0x30    | 0x5ca3 | yes  | yes |
877ebd8b66SMauro Carvalho Chehab+----------+---------+--------+-------+-------+---------+--------+------+-----+
887ebd8b66SMauro Carvalho Chehab| w83783s  | 5-6     | 3      | 2     |  1-2  | 0x40    | 0x5ca3 | yes  |  no |
897ebd8b66SMauro Carvalho Chehab+----------+---------+--------+-------+-------+---------+--------+------+-----+
907ebd8b66SMauro Carvalho Chehab
917ebd8b66SMauro Carvalho ChehabDetection of these chips can sometimes be foiled because they can be in
927ebd8b66SMauro Carvalho Chehaban internal state that allows no clean access. If you know the address
937ebd8b66SMauro Carvalho Chehabof the chip, use a 'force' parameter; this will put them into a more
947ebd8b66SMauro Carvalho Chehabwell-behaved state first.
957ebd8b66SMauro Carvalho Chehab
967ebd8b66SMauro Carvalho ChehabThe W8378* implements temperature sensors (three on the W83781D and W83782D,
977ebd8b66SMauro Carvalho Chehabtwo on the W83783S), three fan rotation speed sensors, voltage sensors
987ebd8b66SMauro Carvalho Chehab(seven on the W83781D, nine on the W83782D and six on the W83783S), VID
997ebd8b66SMauro Carvalho Chehablines, alarms with beep warnings, and some miscellaneous stuff.
1007ebd8b66SMauro Carvalho Chehab
1017ebd8b66SMauro Carvalho ChehabTemperatures are measured in degrees Celsius. There is always one main
1027ebd8b66SMauro Carvalho Chehabtemperature sensor, and one (W83783S) or two (W83781D and W83782D) other
1037ebd8b66SMauro Carvalho Chehabsensors. An alarm is triggered for the main sensor once when the
1047ebd8b66SMauro Carvalho ChehabOvertemperature Shutdown limit is crossed; it is triggered again as soon as
1057ebd8b66SMauro Carvalho Chehabit drops below the Hysteresis value. A more useful behavior
1067ebd8b66SMauro Carvalho Chehabcan be found by setting the Hysteresis value to +127 degrees Celsius; in
1077ebd8b66SMauro Carvalho Chehabthis case, alarms are issued during all the time when the actual temperature
1087ebd8b66SMauro Carvalho Chehabis above the Overtemperature Shutdown value. The driver sets the
1097ebd8b66SMauro Carvalho Chehabhysteresis value for temp1 to 127 at initialization.
1107ebd8b66SMauro Carvalho Chehab
1117ebd8b66SMauro Carvalho ChehabFor the other temperature sensor(s), an alarm is triggered when the
1127ebd8b66SMauro Carvalho Chehabtemperature gets higher then the Overtemperature Shutdown value; it stays
1137ebd8b66SMauro Carvalho Chehabon until the temperature falls below the Hysteresis value. But on the
1147ebd8b66SMauro Carvalho ChehabW83781D, there is only one alarm that functions for both other sensors!
1157ebd8b66SMauro Carvalho ChehabTemperatures are guaranteed within a range of -55 to +125 degrees. The
1167ebd8b66SMauro Carvalho Chehabmain temperature sensors has a resolution of 1 degree; the other sensor(s)
1177ebd8b66SMauro Carvalho Chehabof 0.5 degree.
1187ebd8b66SMauro Carvalho Chehab
1197ebd8b66SMauro Carvalho ChehabFan rotation speeds are reported in RPM (rotations per minute). An alarm is
1207ebd8b66SMauro Carvalho Chehabtriggered if the rotation speed has dropped below a programmable limit. Fan
1217ebd8b66SMauro Carvalho Chehabreadings can be divided by a programmable divider (1, 2, 4 or 8 for the
1227ebd8b66SMauro Carvalho ChehabW83781D; 1, 2, 4, 8, 16, 32, 64 or 128 for the others) to give
1237ebd8b66SMauro Carvalho Chehabthe readings more range or accuracy. Not all RPM values can accurately
1247ebd8b66SMauro Carvalho Chehabbe represented, so some rounding is done. With a divider of 2, the lowest
1257ebd8b66SMauro Carvalho Chehabrepresentable value is around 2600 RPM.
1267ebd8b66SMauro Carvalho Chehab
1277ebd8b66SMauro Carvalho ChehabVoltage sensors (also known as IN sensors) report their values in volts.
1287ebd8b66SMauro Carvalho ChehabAn alarm is triggered if the voltage has crossed a programmable minimum
1297ebd8b66SMauro Carvalho Chehabor maximum limit. Note that minimum in this case always means 'closest to
1307ebd8b66SMauro Carvalho Chehabzero'; this is important for negative voltage measurements. All voltage
1317ebd8b66SMauro Carvalho Chehabinputs can measure voltages between 0 and 4.08 volts, with a resolution
1327ebd8b66SMauro Carvalho Chehabof 0.016 volt.
1337ebd8b66SMauro Carvalho Chehab
1347ebd8b66SMauro Carvalho ChehabThe VID lines encode the core voltage value: the voltage level your processor
1357ebd8b66SMauro Carvalho Chehabshould work with. This is hardcoded by the mainboard and/or processor itself.
1367ebd8b66SMauro Carvalho ChehabIt is a value in volts. When it is unconnected, you will often find the
1377ebd8b66SMauro Carvalho Chehabvalue 3.50 V here.
1387ebd8b66SMauro Carvalho Chehab
1397ebd8b66SMauro Carvalho ChehabThe W83782D and W83783S temperature conversion machine understands about
1407ebd8b66SMauro Carvalho Chehabseveral kinds of temperature probes. You can program the so-called
1417ebd8b66SMauro Carvalho Chehabbeta value in the sensor files. '1' is the PII/Celeron diode, '2' is the
1427ebd8b66SMauro Carvalho ChehabTN3904 transistor, and 3435 the default thermistor value. Other values
1437ebd8b66SMauro Carvalho Chehabare (not yet) supported.
1447ebd8b66SMauro Carvalho Chehab
1457ebd8b66SMauro Carvalho ChehabIn addition to the alarms described above, there is a CHAS alarm on the
1467ebd8b66SMauro Carvalho Chehabchips which triggers if your computer case is open.
1477ebd8b66SMauro Carvalho Chehab
1487ebd8b66SMauro Carvalho ChehabWhen an alarm goes off, you can be warned by a beeping signal through
1497ebd8b66SMauro Carvalho Chehabyour computer speaker. It is possible to enable all beeping globally,
1507ebd8b66SMauro Carvalho Chehabor only the beeping for some alarms.
1517ebd8b66SMauro Carvalho Chehab
1527ebd8b66SMauro Carvalho ChehabIndividual alarm and beep bits:
1537ebd8b66SMauro Carvalho Chehab
1547ebd8b66SMauro Carvalho Chehab======== ==========================
1557ebd8b66SMauro Carvalho Chehab0x000001 in0
1567ebd8b66SMauro Carvalho Chehab0x000002 in1
1577ebd8b66SMauro Carvalho Chehab0x000004 in2
1587ebd8b66SMauro Carvalho Chehab0x000008 in3
1597ebd8b66SMauro Carvalho Chehab0x000010 temp1
1607ebd8b66SMauro Carvalho Chehab0x000020 temp2 (+temp3 on W83781D)
1617ebd8b66SMauro Carvalho Chehab0x000040 fan1
1627ebd8b66SMauro Carvalho Chehab0x000080 fan2
1637ebd8b66SMauro Carvalho Chehab0x000100 in4
1647ebd8b66SMauro Carvalho Chehab0x000200 in5
1657ebd8b66SMauro Carvalho Chehab0x000400 in6
1667ebd8b66SMauro Carvalho Chehab0x000800 fan3
1677ebd8b66SMauro Carvalho Chehab0x001000 chassis
1687ebd8b66SMauro Carvalho Chehab0x002000 temp3 (W83782D only)
1697ebd8b66SMauro Carvalho Chehab0x010000 in7 (W83782D only)
1707ebd8b66SMauro Carvalho Chehab0x020000 in8 (W83782D only)
1717ebd8b66SMauro Carvalho Chehab======== ==========================
1727ebd8b66SMauro Carvalho Chehab
1737ebd8b66SMauro Carvalho ChehabIf an alarm triggers, it will remain triggered until the hardware register
1747ebd8b66SMauro Carvalho Chehabis read at least once. This means that the cause for the alarm may
1757ebd8b66SMauro Carvalho Chehabalready have disappeared! Note that in the current implementation, all
1767ebd8b66SMauro Carvalho Chehabhardware registers are read whenever any data is read (unless it is less
1777ebd8b66SMauro Carvalho Chehabthan 1.5 seconds since the last update). This means that you can easily
1787ebd8b66SMauro Carvalho Chehabmiss once-only alarms.
1797ebd8b66SMauro Carvalho Chehab
1807ebd8b66SMauro Carvalho ChehabThe chips only update values each 1.5 seconds; reading them more often
1817ebd8b66SMauro Carvalho Chehabwill do no harm, but will return 'old' values.
1827ebd8b66SMauro Carvalho Chehab
1837ebd8b66SMauro Carvalho ChehabAS99127F PROBLEMS
1847ebd8b66SMauro Carvalho Chehab-----------------
1857ebd8b66SMauro Carvalho ChehabThe as99127f support was developed without the benefit of a datasheet.
1867ebd8b66SMauro Carvalho ChehabIn most cases it is treated as a w83781d (although revision 2 of the
1877ebd8b66SMauro Carvalho ChehabAS99127F looks more like a w83782d).
1887ebd8b66SMauro Carvalho ChehabThis support will be BETA until a datasheet is released.
1897ebd8b66SMauro Carvalho ChehabOne user has reported problems with fans stopping
1907ebd8b66SMauro Carvalho Chehaboccasionally.
1917ebd8b66SMauro Carvalho Chehab
1927ebd8b66SMauro Carvalho ChehabNote that the individual beep bits are inverted from the other chips.
1937ebd8b66SMauro Carvalho ChehabThe driver now takes care of this so that user-space applications
1947ebd8b66SMauro Carvalho Chehabdon't have to know about it.
1957ebd8b66SMauro Carvalho Chehab
1967ebd8b66SMauro Carvalho ChehabKnown problems:
1977ebd8b66SMauro Carvalho Chehab	- Problems with diode/thermistor settings (supported?)
1987ebd8b66SMauro Carvalho Chehab	- One user reports fans stopping under high server load.
1997ebd8b66SMauro Carvalho Chehab	- Revision 2 seems to have 2 PWM registers but we don't know
2007ebd8b66SMauro Carvalho Chehab	  how to handle them. More details below.
2017ebd8b66SMauro Carvalho Chehab
2027ebd8b66SMauro Carvalho ChehabThese will not be fixed unless we get a datasheet.
2037ebd8b66SMauro Carvalho ChehabIf you have problems, please lobby Asus to release a datasheet.
2047ebd8b66SMauro Carvalho ChehabUnfortunately several others have without success.
2057ebd8b66SMauro Carvalho ChehabPlease do not send mail to us asking for better as99127f support.
2067ebd8b66SMauro Carvalho ChehabWe have done the best we can without a datasheet.
2077ebd8b66SMauro Carvalho ChehabPlease do not send mail to the author or the sensors group asking for
2087ebd8b66SMauro Carvalho Chehaba datasheet or ideas on how to convince Asus. We can't help.
2097ebd8b66SMauro Carvalho Chehab
2107ebd8b66SMauro Carvalho Chehab
2117ebd8b66SMauro Carvalho ChehabNOTES
2127ebd8b66SMauro Carvalho Chehab-----
2137ebd8b66SMauro Carvalho Chehab  783s has no in1 so that in[2-6] are compatible with the 781d/782d.
2147ebd8b66SMauro Carvalho Chehab
2157ebd8b66SMauro Carvalho Chehab  783s pin is programmable for -5V or temp1; defaults to -5V,
2167ebd8b66SMauro Carvalho Chehab  no control in driver so temp1 doesn't work.
2177ebd8b66SMauro Carvalho Chehab
2187ebd8b66SMauro Carvalho Chehab  782d and 783s datasheets differ on which is pwm1 and which is pwm2.
2197ebd8b66SMauro Carvalho Chehab  We chose to follow 782d.
2207ebd8b66SMauro Carvalho Chehab
2217ebd8b66SMauro Carvalho Chehab  782d and 783s pin is programmable for fan3 input or pwm2 output;
2227ebd8b66SMauro Carvalho Chehab  defaults to fan3 input.
2237ebd8b66SMauro Carvalho Chehab  If pwm2 is enabled (with echo 255 1 > pwm2), then
2247ebd8b66SMauro Carvalho Chehab  fan3 will report 0.
2257ebd8b66SMauro Carvalho Chehab
2267ebd8b66SMauro Carvalho Chehab  782d has pwm1-2 for ISA, pwm1-4 for i2c. (pwm3-4 share pins with
2277ebd8b66SMauro Carvalho Chehab  the ISA pins)
2287ebd8b66SMauro Carvalho Chehab
2297ebd8b66SMauro Carvalho ChehabData sheet updates
2307ebd8b66SMauro Carvalho Chehab------------------
2317ebd8b66SMauro Carvalho Chehab	- PWM clock registers:
2327ebd8b66SMauro Carvalho Chehab		* 000: master /  512
2337ebd8b66SMauro Carvalho Chehab		* 001: master / 1024
2347ebd8b66SMauro Carvalho Chehab		* 010: master / 2048
2357ebd8b66SMauro Carvalho Chehab		* 011: master / 4096
2367ebd8b66SMauro Carvalho Chehab		* 100: master / 8192
2377ebd8b66SMauro Carvalho Chehab
2387ebd8b66SMauro Carvalho Chehab
2397ebd8b66SMauro Carvalho ChehabAnswers from Winbond tech support
2407ebd8b66SMauro Carvalho Chehab---------------------------------
2417ebd8b66SMauro Carvalho Chehab
2427ebd8b66SMauro Carvalho Chehab::
2437ebd8b66SMauro Carvalho Chehab
2447ebd8b66SMauro Carvalho Chehab  >
2457ebd8b66SMauro Carvalho Chehab  > 1) In the W83781D data sheet section 7.2 last paragraph, it talks about
2467ebd8b66SMauro Carvalho Chehab  >    reprogramming the R-T table if the Beta of the thermistor is not
2477ebd8b66SMauro Carvalho Chehab  >    3435K. The R-T table is described briefly in section 8.20.
2487ebd8b66SMauro Carvalho Chehab  >    What formulas do I use to program a new R-T table for a given Beta?
2497ebd8b66SMauro Carvalho Chehab  >
2507ebd8b66SMauro Carvalho Chehab
2517ebd8b66SMauro Carvalho Chehab  We are sorry that the calculation for R-T table value is
2527ebd8b66SMauro Carvalho Chehab  confidential. If you have another Beta value of thermistor, we can help
2537ebd8b66SMauro Carvalho Chehab  to calculate the R-T table for you. But you should give us real R-T
2547ebd8b66SMauro Carvalho Chehab  Table which can be gotten by thermistor vendor. Therefore we will calculate
2557ebd8b66SMauro Carvalho Chehab  them and obtain 32-byte data, and you can fill the 32-byte data to the
2567ebd8b66SMauro Carvalho Chehab  register in Bank0.CR51 of W83781D.
2577ebd8b66SMauro Carvalho Chehab
2587ebd8b66SMauro Carvalho Chehab
2597ebd8b66SMauro Carvalho Chehab  > 2) In the W83782D data sheet, it mentions that pins 38, 39, and 40 are
2607ebd8b66SMauro Carvalho Chehab  >    programmable to be either thermistor or Pentium II diode inputs.
2617ebd8b66SMauro Carvalho Chehab  >    How do I program them for diode inputs? I can't find any register
2627ebd8b66SMauro Carvalho Chehab  >    to program these to be diode inputs.
2637ebd8b66SMauro Carvalho Chehab
2647ebd8b66SMauro Carvalho Chehab  You may program Bank0 CR[5Dh] and CR[59h] registers.
2657ebd8b66SMauro Carvalho Chehab
2667ebd8b66SMauro Carvalho Chehab  =============================== =============== ============== ============
2677ebd8b66SMauro Carvalho Chehab	CR[5Dh]    		bit 1(VTIN1)    bit 2(VTIN2)   bit 3(VTIN3)
2687ebd8b66SMauro Carvalho Chehab
2697ebd8b66SMauro Carvalho Chehab		thermistor                0		 0		0
2707ebd8b66SMauro Carvalho Chehab	diode 			  1		 1		1
2717ebd8b66SMauro Carvalho Chehab
2727ebd8b66SMauro Carvalho Chehab
2737ebd8b66SMauro Carvalho Chehab  (error) CR[59h] 		bit 4(VTIN1)	bit 2(VTIN2)   bit 3(VTIN3)
2747ebd8b66SMauro Carvalho Chehab  (right) CR[59h] 		bit 4(VTIN1)	bit 5(VTIN2)   bit 6(VTIN3)
2757ebd8b66SMauro Carvalho Chehab
2767ebd8b66SMauro Carvalho Chehab	PII thermal diode         1		 1		1
2777ebd8b66SMauro Carvalho Chehab	2N3904	diode		  0		 0		0
2787ebd8b66SMauro Carvalho Chehab  =============================== =============== ============== ============
2797ebd8b66SMauro Carvalho Chehab
2807ebd8b66SMauro Carvalho Chehab
2817ebd8b66SMauro Carvalho ChehabAsus Clones
2827ebd8b66SMauro Carvalho Chehab-----------
2837ebd8b66SMauro Carvalho Chehab
2847ebd8b66SMauro Carvalho ChehabWe have no datasheets for the Asus clones (AS99127F and ASB100 Bach).
2857ebd8b66SMauro Carvalho ChehabHere are some very useful information that were given to us by Alex Van
2867ebd8b66SMauro Carvalho ChehabKaam about how to detect these chips, and how to read their values. He
2877ebd8b66SMauro Carvalho Chehabalso gives advice for another Asus chipset, the Mozart-2 (which we
2887ebd8b66SMauro Carvalho Chehabdon't support yet). Thanks Alex!
2897ebd8b66SMauro Carvalho Chehab
2907ebd8b66SMauro Carvalho ChehabI reworded some parts and added personal comments.
2917ebd8b66SMauro Carvalho Chehab
2927ebd8b66SMauro Carvalho ChehabDetection
2937ebd8b66SMauro Carvalho Chehab^^^^^^^^^
2947ebd8b66SMauro Carvalho Chehab
2957ebd8b66SMauro Carvalho ChehabAS99127F rev.1, AS99127F rev.2 and ASB100:
2967ebd8b66SMauro Carvalho Chehab- I2C address range: 0x29 - 0x2F
2977ebd8b66SMauro Carvalho Chehab- If register 0x58 holds 0x31 then we have an Asus (either ASB100 or AS99127F)
2987ebd8b66SMauro Carvalho Chehab- Which one depends on register 0x4F (manufacturer ID):
2997ebd8b66SMauro Carvalho Chehab
3007ebd8b66SMauro Carvalho Chehab  - 0x06 or 0x94: ASB100
3017ebd8b66SMauro Carvalho Chehab  - 0x12 or 0xC3: AS99127F rev.1
3027ebd8b66SMauro Carvalho Chehab  - 0x5C or 0xA3: AS99127F rev.2
3037ebd8b66SMauro Carvalho Chehab
3047ebd8b66SMauro Carvalho Chehab  Note that 0x5CA3 is Winbond's ID (WEC), which let us think Asus get their
3057ebd8b66SMauro Carvalho Chehab  AS99127F rev.2 direct from Winbond. The other codes mean ATT and DVC,
3067ebd8b66SMauro Carvalho Chehab  respectively. ATT could stand for Asustek something (although it would be
3077ebd8b66SMauro Carvalho Chehab  very badly chosen IMHO), I don't know what DVC could stand for. Maybe
3087ebd8b66SMauro Carvalho Chehab  these codes simply aren't meant to be decoded that way.
3097ebd8b66SMauro Carvalho Chehab
3107ebd8b66SMauro Carvalho ChehabMozart-2:
3117ebd8b66SMauro Carvalho Chehab- I2C address: 0x77
3127ebd8b66SMauro Carvalho Chehab- If register 0x58 holds 0x56 or 0x10 then we have a Mozart-2
3137ebd8b66SMauro Carvalho Chehab- Of the Mozart there are 3 types:
3147ebd8b66SMauro Carvalho Chehab
3157ebd8b66SMauro Carvalho Chehab  - 0x58=0x56, 0x4E=0x94, 0x4F=0x36: Asus ASM58 Mozart-2
3167ebd8b66SMauro Carvalho Chehab  - 0x58=0x56, 0x4E=0x94, 0x4F=0x06: Asus AS2K129R Mozart-2
3177ebd8b66SMauro Carvalho Chehab  - 0x58=0x10, 0x4E=0x5C, 0x4F=0xA3: Asus ??? Mozart-2
3187ebd8b66SMauro Carvalho Chehab
3197ebd8b66SMauro Carvalho Chehab  You can handle all 3 the exact same way :)
3207ebd8b66SMauro Carvalho Chehab
3217ebd8b66SMauro Carvalho ChehabTemperature sensors
3227ebd8b66SMauro Carvalho Chehab^^^^^^^^^^^^^^^^^^^
3237ebd8b66SMauro Carvalho Chehab
3247ebd8b66SMauro Carvalho ChehabASB100:
3257ebd8b66SMauro Carvalho Chehab  - sensor 1: register 0x27
3267ebd8b66SMauro Carvalho Chehab  - sensor 2 & 3 are the 2 LM75's on the SMBus
3277ebd8b66SMauro Carvalho Chehab  - sensor 4: register 0x17
3287ebd8b66SMauro Carvalho Chehab
3297ebd8b66SMauro Carvalho ChehabRemark:
3307ebd8b66SMauro Carvalho Chehab
3317ebd8b66SMauro Carvalho Chehab  I noticed that on Intel boards sensor 2 is used for the CPU
3327ebd8b66SMauro Carvalho Chehab  and 4 is ignored/stuck, on AMD boards sensor 4 is the CPU and sensor 2 is
3337ebd8b66SMauro Carvalho Chehab  either ignored or a socket temperature.
3347ebd8b66SMauro Carvalho Chehab
3357ebd8b66SMauro Carvalho ChehabAS99127F (rev.1 and 2 alike):
3367ebd8b66SMauro Carvalho Chehab  - sensor 1: register 0x27
3377ebd8b66SMauro Carvalho Chehab  - sensor 2 & 3 are the 2 LM75's on the SMBus
3387ebd8b66SMauro Carvalho Chehab
3397ebd8b66SMauro Carvalho ChehabRemark:
3407ebd8b66SMauro Carvalho Chehab
3417ebd8b66SMauro Carvalho Chehab  Register 0x5b is suspected to be temperature type selector. Bit 1
3427ebd8b66SMauro Carvalho Chehab  would control temp1, bit 3 temp2 and bit 5 temp3.
3437ebd8b66SMauro Carvalho Chehab
3447ebd8b66SMauro Carvalho ChehabMozart-2:
3457ebd8b66SMauro Carvalho Chehab  - sensor 1: register 0x27
3467ebd8b66SMauro Carvalho Chehab  - sensor 2: register 0x13
3477ebd8b66SMauro Carvalho Chehab
3487ebd8b66SMauro Carvalho ChehabFan sensors
3497ebd8b66SMauro Carvalho Chehab^^^^^^^^^^^
3507ebd8b66SMauro Carvalho Chehab
3517ebd8b66SMauro Carvalho ChehabASB100, AS99127F (rev.1 and 2 alike):
3527ebd8b66SMauro Carvalho Chehab  - 3 fans, identical to the W83781D
3537ebd8b66SMauro Carvalho Chehab
3547ebd8b66SMauro Carvalho ChehabMozart-2:
3557ebd8b66SMauro Carvalho Chehab  - 2 fans only, 1350000/RPM/div
3567ebd8b66SMauro Carvalho Chehab  - fan 1: register 0x28,  divisor on register 0xA1 (bits 4-5)
3577ebd8b66SMauro Carvalho Chehab  - fan 2: register 0x29,  divisor on register 0xA1 (bits 6-7)
3587ebd8b66SMauro Carvalho Chehab
3597ebd8b66SMauro Carvalho ChehabVoltages
3607ebd8b66SMauro Carvalho Chehab^^^^^^^^
3617ebd8b66SMauro Carvalho Chehab
3627ebd8b66SMauro Carvalho ChehabThis is where there is a difference between AS99127F rev.1 and 2.
3637ebd8b66SMauro Carvalho Chehab
3647ebd8b66SMauro Carvalho ChehabRemark:
3657ebd8b66SMauro Carvalho Chehab
3667ebd8b66SMauro Carvalho Chehab  The difference is similar to the difference between
3677ebd8b66SMauro Carvalho Chehab  W83781D and W83782D.
3687ebd8b66SMauro Carvalho Chehab
3697ebd8b66SMauro Carvalho ChehabASB100:
3707ebd8b66SMauro Carvalho Chehab  - in0=r(0x20)*0.016
3717ebd8b66SMauro Carvalho Chehab  - in1=r(0x21)*0.016
3727ebd8b66SMauro Carvalho Chehab  - in2=r(0x22)*0.016
3737ebd8b66SMauro Carvalho Chehab  - in3=r(0x23)*0.016*1.68
3747ebd8b66SMauro Carvalho Chehab  - in4=r(0x24)*0.016*3.8
3757ebd8b66SMauro Carvalho Chehab  - in5=r(0x25)*(-0.016)*3.97
3767ebd8b66SMauro Carvalho Chehab  - in6=r(0x26)*(-0.016)*1.666
3777ebd8b66SMauro Carvalho Chehab
3787ebd8b66SMauro Carvalho ChehabAS99127F rev.1:
3797ebd8b66SMauro Carvalho Chehab  - in0=r(0x20)*0.016
3807ebd8b66SMauro Carvalho Chehab  - in1=r(0x21)*0.016
3817ebd8b66SMauro Carvalho Chehab  - in2=r(0x22)*0.016
3827ebd8b66SMauro Carvalho Chehab  - in3=r(0x23)*0.016*1.68
3837ebd8b66SMauro Carvalho Chehab  - in4=r(0x24)*0.016*3.8
3847ebd8b66SMauro Carvalho Chehab  - in5=r(0x25)*(-0.016)*3.97
3857ebd8b66SMauro Carvalho Chehab  - in6=r(0x26)*(-0.016)*1.503
3867ebd8b66SMauro Carvalho Chehab
3877ebd8b66SMauro Carvalho ChehabAS99127F rev.2:
3887ebd8b66SMauro Carvalho Chehab  - in0=r(0x20)*0.016
3897ebd8b66SMauro Carvalho Chehab  - in1=r(0x21)*0.016
3907ebd8b66SMauro Carvalho Chehab  - in2=r(0x22)*0.016
3917ebd8b66SMauro Carvalho Chehab  - in3=r(0x23)*0.016*1.68
3927ebd8b66SMauro Carvalho Chehab  - in4=r(0x24)*0.016*3.8
3937ebd8b66SMauro Carvalho Chehab  - in5=(r(0x25)*0.016-3.6)*5.14+3.6
3947ebd8b66SMauro Carvalho Chehab  - in6=(r(0x26)*0.016-3.6)*3.14+3.6
3957ebd8b66SMauro Carvalho Chehab
3967ebd8b66SMauro Carvalho ChehabMozart-2:
3977ebd8b66SMauro Carvalho Chehab  - in0=r(0x20)*0.016
3987ebd8b66SMauro Carvalho Chehab  - in1=255
3997ebd8b66SMauro Carvalho Chehab  - in2=r(0x22)*0.016
4007ebd8b66SMauro Carvalho Chehab  - in3=r(0x23)*0.016*1.68
4017ebd8b66SMauro Carvalho Chehab  - in4=r(0x24)*0.016*4
4027ebd8b66SMauro Carvalho Chehab  - in5=255
4037ebd8b66SMauro Carvalho Chehab  - in6=255
4047ebd8b66SMauro Carvalho Chehab
4057ebd8b66SMauro Carvalho Chehab
4067ebd8b66SMauro Carvalho ChehabPWM
4077ebd8b66SMauro Carvalho Chehab^^^
4087ebd8b66SMauro Carvalho Chehab
4097ebd8b66SMauro Carvalho Chehab* Additional info about PWM on the AS99127F (may apply to other Asus
4107ebd8b66SMauro Carvalho Chehab  chips as well) by Jean Delvare as of 2004-04-09:
4117ebd8b66SMauro Carvalho Chehab
4127ebd8b66SMauro Carvalho ChehabAS99127F revision 2 seems to have two PWM registers at 0x59 and 0x5A,
4137ebd8b66SMauro Carvalho Chehaband a temperature sensor type selector at 0x5B (which basically means
4147ebd8b66SMauro Carvalho Chehabthat they swapped registers 0x59 and 0x5B when you compare with Winbond
4157ebd8b66SMauro Carvalho Chehabchips).
4167ebd8b66SMauro Carvalho ChehabRevision 1 of the chip also has the temperature sensor type selector at
4177ebd8b66SMauro Carvalho Chehab0x5B, but PWM registers have no effect.
4187ebd8b66SMauro Carvalho Chehab
4197ebd8b66SMauro Carvalho ChehabWe don't know exactly how the temperature sensor type selection works.
4207ebd8b66SMauro Carvalho ChehabLooks like bits 1-0 are for temp1, bits 3-2 for temp2 and bits 5-4 for
4217ebd8b66SMauro Carvalho Chehabtemp3, although it is possible that only the most significant bit matters
4227ebd8b66SMauro Carvalho Chehabeach time. So far, values other than 0 always broke the readings.
4237ebd8b66SMauro Carvalho Chehab
4247ebd8b66SMauro Carvalho ChehabPWM registers seem to be split in two parts: bit 7 is a mode selector,
4257ebd8b66SMauro Carvalho Chehabwhile the other bits seem to define a value or threshold.
4267ebd8b66SMauro Carvalho Chehab
4277ebd8b66SMauro Carvalho ChehabWhen bit 7 is clear, bits 6-0 seem to hold a threshold value. If the value
4287ebd8b66SMauro Carvalho Chehabis below a given limit, the fan runs at low speed. If the value is above
4297ebd8b66SMauro Carvalho Chehabthe limit, the fan runs at full speed. We have no clue as to what the limit
4307ebd8b66SMauro Carvalho Chehabrepresents. Note that there seem to be some inertia in this mode, speed
4317ebd8b66SMauro Carvalho Chehabchanges may need some time to trigger. Also, an hysteresis mechanism is
4327ebd8b66SMauro Carvalho Chehabsuspected since walking through all the values increasingly and then
4337ebd8b66SMauro Carvalho Chehabdecreasingly led to slightly different limits.
4347ebd8b66SMauro Carvalho Chehab
4357ebd8b66SMauro Carvalho ChehabWhen bit 7 is set, bits 3-0 seem to hold a threshold value, while bits 6-4
4367ebd8b66SMauro Carvalho Chehabwould not be significant. If the value is below a given limit, the fan runs
4377ebd8b66SMauro Carvalho Chehabat full speed, while if it is above the limit it runs at low speed (so this
4387ebd8b66SMauro Carvalho Chehabis the contrary of the other mode, in a way). Here again, we don't know
4397ebd8b66SMauro Carvalho Chehabwhat the limit is supposed to represent.
4407ebd8b66SMauro Carvalho Chehab
4417ebd8b66SMauro Carvalho ChehabOne remarkable thing is that the fans would only have two or three
4427ebd8b66SMauro Carvalho Chehabdifferent speeds (transitional states left apart), not a whole range as
4437ebd8b66SMauro Carvalho Chehabyou usually get with PWM.
4447ebd8b66SMauro Carvalho Chehab
4457ebd8b66SMauro Carvalho ChehabAs a conclusion, you can write 0x00 or 0x8F to the PWM registers to make
4467ebd8b66SMauro Carvalho Chehabfans run at low speed, and 0x7F or 0x80 to make them run at full speed.
4477ebd8b66SMauro Carvalho Chehab
4487ebd8b66SMauro Carvalho ChehabPlease contact us if you can figure out how it is supposed to work. As
4497ebd8b66SMauro Carvalho Chehablong as we don't know more, the w83781d driver doesn't handle PWM on
4507ebd8b66SMauro Carvalho ChehabAS99127F chips at all.
4517ebd8b66SMauro Carvalho Chehab
4527ebd8b66SMauro Carvalho Chehab* Additional info about PWM on the AS99127F rev.1 by Hector Martin:
4537ebd8b66SMauro Carvalho Chehab
4547ebd8b66SMauro Carvalho ChehabI've been fiddling around with the (in)famous 0x59 register and
4557ebd8b66SMauro Carvalho Chehabfound out the following values do work as a form of coarse pwm:
4567ebd8b66SMauro Carvalho Chehab
4577ebd8b66SMauro Carvalho Chehab0x80
4587ebd8b66SMauro Carvalho Chehab - seems to turn fans off after some time(1-2 minutes)... might be
4597ebd8b66SMauro Carvalho Chehab   some form of auto-fan-control based on temp? hmm (Qfan? this mobo is an
4607ebd8b66SMauro Carvalho Chehab   old ASUS, it isn't marketed as Qfan. Maybe some beta pre-attempt at Qfan
4617ebd8b66SMauro Carvalho Chehab   that was dropped at the BIOS)
4627ebd8b66SMauro Carvalho Chehab0x81
4637ebd8b66SMauro Carvalho Chehab - off
4647ebd8b66SMauro Carvalho Chehab0x82
4657ebd8b66SMauro Carvalho Chehab - slightly "on-ner" than off, but my fans do not get to move. I can
4667ebd8b66SMauro Carvalho Chehab   hear the high-pitched PWM sound that motors give off at too-low-pwm.
4677ebd8b66SMauro Carvalho Chehab0x83
4687ebd8b66SMauro Carvalho Chehab - now they do move. Estimate about 70% speed or so.
4697ebd8b66SMauro Carvalho Chehab0x84-0x8f
4707ebd8b66SMauro Carvalho Chehab - full on
4717ebd8b66SMauro Carvalho Chehab
4727ebd8b66SMauro Carvalho ChehabChanging the high nibble doesn't seem to do much except the high bit
4737ebd8b66SMauro Carvalho Chehab(0x80) must be set for PWM to work, else the current pwm doesn't seem to
4747ebd8b66SMauro Carvalho Chehabchange.
4757ebd8b66SMauro Carvalho Chehab
4767ebd8b66SMauro Carvalho ChehabMy mobo is an ASUS A7V266-E. This behavior is similar to what I got
4777ebd8b66SMauro Carvalho Chehabwith speedfan under Windows, where 0-15% would be off, 15-2x% (can't
4787ebd8b66SMauro Carvalho Chehabremember the exact value) would be 70% and higher would be full on.
4797ebd8b66SMauro Carvalho Chehab
4807ebd8b66SMauro Carvalho Chehab* Additional info about PWM on the AS99127F rev.1 from lm-sensors
4817ebd8b66SMauro Carvalho Chehab  ticket #2350:
4827ebd8b66SMauro Carvalho Chehab
4837ebd8b66SMauro Carvalho ChehabI conducted some experiment on Asus P3B-F motherboard with AS99127F
4847ebd8b66SMauro Carvalho Chehab(Ver. 1).
4857ebd8b66SMauro Carvalho Chehab
4867ebd8b66SMauro Carvalho ChehabI confirm that 0x59 register control the CPU_Fan Header on this
4877ebd8b66SMauro Carvalho Chehabmotherboard, and 0x5a register control PWR_Fan.
4887ebd8b66SMauro Carvalho Chehab
4897ebd8b66SMauro Carvalho ChehabIn order to reduce the dependency of specific fan, the measurement is
4907ebd8b66SMauro Carvalho Chehabconducted with a digital scope without fan connected. I found out that
4917ebd8b66SMauro Carvalho ChehabP3B-F actually output variable DC voltage on fan header center pin,
4927ebd8b66SMauro Carvalho Chehablooks like PWM is filtered on this motherboard.
4937ebd8b66SMauro Carvalho Chehab
4947ebd8b66SMauro Carvalho ChehabHere are some of measurements:
4957ebd8b66SMauro Carvalho Chehab
4967ebd8b66SMauro Carvalho Chehab==== =========
4977ebd8b66SMauro Carvalho Chehab0x80     20 mV
4987ebd8b66SMauro Carvalho Chehab0x81     20 mV
4997ebd8b66SMauro Carvalho Chehab0x82    232 mV
5007ebd8b66SMauro Carvalho Chehab0x83   1.2  V
5017ebd8b66SMauro Carvalho Chehab0x84   2.31 V
5027ebd8b66SMauro Carvalho Chehab0x85   3.44 V
5037ebd8b66SMauro Carvalho Chehab0x86   4.62 V
5047ebd8b66SMauro Carvalho Chehab0x87   5.81 V
5057ebd8b66SMauro Carvalho Chehab0x88   7.01 V
5067ebd8b66SMauro Carvalho Chehab9x89   8.22 V
5077ebd8b66SMauro Carvalho Chehab0x8a   9.42 V
5087ebd8b66SMauro Carvalho Chehab0x8b  10.6  V
5097ebd8b66SMauro Carvalho Chehab0x8c  11.9  V
5107ebd8b66SMauro Carvalho Chehab0x8d  12.4  V
5117ebd8b66SMauro Carvalho Chehab0x8e  12.4  V
5127ebd8b66SMauro Carvalho Chehab0x8f  12.4  V
5137ebd8b66SMauro Carvalho Chehab==== =========
514