xref: /openbmc/linux/Documentation/hwmon/w83792d.rst (revision c39f2d9db0fd81ea20bb5cce9b3f082ca63753e2)
1*7ebd8b66SMauro Carvalho ChehabKernel driver w83792d
2*7ebd8b66SMauro Carvalho Chehab=====================
3*7ebd8b66SMauro Carvalho Chehab
4*7ebd8b66SMauro Carvalho ChehabSupported chips:
5*7ebd8b66SMauro Carvalho Chehab
6*7ebd8b66SMauro Carvalho Chehab  * Winbond W83792D
7*7ebd8b66SMauro Carvalho Chehab
8*7ebd8b66SMauro Carvalho Chehab    Prefix: 'w83792d'
9*7ebd8b66SMauro Carvalho Chehab
10*7ebd8b66SMauro Carvalho Chehab    Addresses scanned: I2C 0x2c - 0x2f
11*7ebd8b66SMauro Carvalho Chehab
12*7ebd8b66SMauro Carvalho Chehab    Datasheet: http://www.winbond.com.tw
13*7ebd8b66SMauro Carvalho Chehab
14*7ebd8b66SMauro Carvalho ChehabAuthor: Shane Huang (Winbond)
15*7ebd8b66SMauro Carvalho ChehabUpdated: Roger Lucas
16*7ebd8b66SMauro Carvalho Chehab
17*7ebd8b66SMauro Carvalho Chehab
18*7ebd8b66SMauro Carvalho ChehabModule Parameters
19*7ebd8b66SMauro Carvalho Chehab-----------------
20*7ebd8b66SMauro Carvalho Chehab
21*7ebd8b66SMauro Carvalho Chehab* init int
22*7ebd8b66SMauro Carvalho Chehab    (default 1)
23*7ebd8b66SMauro Carvalho Chehab
24*7ebd8b66SMauro Carvalho Chehab    Use 'init=0' to bypass initializing the chip.
25*7ebd8b66SMauro Carvalho Chehab    Try this if your computer crashes when you load the module.
26*7ebd8b66SMauro Carvalho Chehab
27*7ebd8b66SMauro Carvalho Chehab* force_subclients=bus,caddr,saddr,saddr
28*7ebd8b66SMauro Carvalho Chehab    This is used to force the i2c addresses for subclients of
29*7ebd8b66SMauro Carvalho Chehab    a certain chip. Example usage is `force_subclients=0,0x2f,0x4a,0x4b`
30*7ebd8b66SMauro Carvalho Chehab    to force the subclients of chip 0x2f on bus 0 to i2c addresses
31*7ebd8b66SMauro Carvalho Chehab    0x4a and 0x4b.
32*7ebd8b66SMauro Carvalho Chehab
33*7ebd8b66SMauro Carvalho Chehab
34*7ebd8b66SMauro Carvalho ChehabDescription
35*7ebd8b66SMauro Carvalho Chehab-----------
36*7ebd8b66SMauro Carvalho Chehab
37*7ebd8b66SMauro Carvalho ChehabThis driver implements support for the Winbond W83792AD/D.
38*7ebd8b66SMauro Carvalho Chehab
39*7ebd8b66SMauro Carvalho ChehabDetection of the chip can sometimes be foiled because it can be in an
40*7ebd8b66SMauro Carvalho Chehabinternal state that allows no clean access (Bank with ID register is not
41*7ebd8b66SMauro Carvalho Chehabcurrently selected). If you know the address of the chip, use a 'force'
42*7ebd8b66SMauro Carvalho Chehabparameter; this will put it into a more well-behaved state first.
43*7ebd8b66SMauro Carvalho Chehab
44*7ebd8b66SMauro Carvalho ChehabThe driver implements three temperature sensors, seven fan rotation speed
45*7ebd8b66SMauro Carvalho Chehabsensors, nine voltage sensors, and two automatic fan regulation
46*7ebd8b66SMauro Carvalho Chehabstrategies called: Smart Fan I (Thermal Cruise mode) and Smart Fan II.
47*7ebd8b66SMauro Carvalho Chehab
48*7ebd8b66SMauro Carvalho ChehabThe driver also implements up to seven fan control outputs: pwm1-7.  Pwm1-7
49*7ebd8b66SMauro Carvalho Chehabcan be configured to PWM output or Analogue DC output via their associated
50*7ebd8b66SMauro Carvalho ChehabpwmX_mode. Outputs pwm4 through pwm7 may or may not be present depending on
51*7ebd8b66SMauro Carvalho Chehabhow the W83792AD/D was configured by the BIOS.
52*7ebd8b66SMauro Carvalho Chehab
53*7ebd8b66SMauro Carvalho ChehabAutomatic fan control mode is possible only for fan1-fan3.
54*7ebd8b66SMauro Carvalho Chehab
55*7ebd8b66SMauro Carvalho ChehabFor all pwmX outputs, a value of 0 means minimum fan speed and a value of
56*7ebd8b66SMauro Carvalho Chehab255 means maximum fan speed.
57*7ebd8b66SMauro Carvalho Chehab
58*7ebd8b66SMauro Carvalho ChehabTemperatures are measured in degrees Celsius and measurement resolution is 1
59*7ebd8b66SMauro Carvalho ChehabdegC for temp1 and 0.5 degC for temp2 and temp3. An alarm is triggered when
60*7ebd8b66SMauro Carvalho Chehabthe temperature gets higher than the Overtemperature Shutdown value; it stays
61*7ebd8b66SMauro Carvalho Chehabon until the temperature falls below the Hysteresis value.
62*7ebd8b66SMauro Carvalho Chehab
63*7ebd8b66SMauro Carvalho ChehabFan rotation speeds are reported in RPM (rotations per minute). An alarm is
64*7ebd8b66SMauro Carvalho Chehabtriggered if the rotation speed has dropped below a programmable limit. Fan
65*7ebd8b66SMauro Carvalho Chehabreadings can be divided by a programmable divider (1, 2, 4, 8, 16, 32, 64 or
66*7ebd8b66SMauro Carvalho Chehab128) to give the readings more range or accuracy.
67*7ebd8b66SMauro Carvalho Chehab
68*7ebd8b66SMauro Carvalho ChehabVoltage sensors (also known as IN sensors) report their values in millivolts.
69*7ebd8b66SMauro Carvalho ChehabAn alarm is triggered if the voltage has crossed a programmable minimum
70*7ebd8b66SMauro Carvalho Chehabor maximum limit.
71*7ebd8b66SMauro Carvalho Chehab
72*7ebd8b66SMauro Carvalho ChehabAlarms are provided as output from "realtime status register". Following bits
73*7ebd8b66SMauro Carvalho Chehabare defined:
74*7ebd8b66SMauro Carvalho Chehab
75*7ebd8b66SMauro Carvalho Chehab==== ==========
76*7ebd8b66SMauro Carvalho Chehabbit   alarm on
77*7ebd8b66SMauro Carvalho Chehab==== ==========
78*7ebd8b66SMauro Carvalho Chehab0    in0
79*7ebd8b66SMauro Carvalho Chehab1    in1
80*7ebd8b66SMauro Carvalho Chehab2    temp1
81*7ebd8b66SMauro Carvalho Chehab3    temp2
82*7ebd8b66SMauro Carvalho Chehab4    temp3
83*7ebd8b66SMauro Carvalho Chehab5    fan1
84*7ebd8b66SMauro Carvalho Chehab6    fan2
85*7ebd8b66SMauro Carvalho Chehab7    fan3
86*7ebd8b66SMauro Carvalho Chehab8    in2
87*7ebd8b66SMauro Carvalho Chehab9    in3
88*7ebd8b66SMauro Carvalho Chehab10   in4
89*7ebd8b66SMauro Carvalho Chehab11   in5
90*7ebd8b66SMauro Carvalho Chehab12   in6
91*7ebd8b66SMauro Carvalho Chehab13   VID change
92*7ebd8b66SMauro Carvalho Chehab14   chassis
93*7ebd8b66SMauro Carvalho Chehab15   fan7
94*7ebd8b66SMauro Carvalho Chehab16   tart1
95*7ebd8b66SMauro Carvalho Chehab17   tart2
96*7ebd8b66SMauro Carvalho Chehab18   tart3
97*7ebd8b66SMauro Carvalho Chehab19   in7
98*7ebd8b66SMauro Carvalho Chehab20   in8
99*7ebd8b66SMauro Carvalho Chehab21   fan4
100*7ebd8b66SMauro Carvalho Chehab22   fan5
101*7ebd8b66SMauro Carvalho Chehab23   fan6
102*7ebd8b66SMauro Carvalho Chehab==== ==========
103*7ebd8b66SMauro Carvalho Chehab
104*7ebd8b66SMauro Carvalho ChehabTart will be asserted while target temperature cannot be achieved after 3 minutes
105*7ebd8b66SMauro Carvalho Chehabof full speed rotation of corresponding fan.
106*7ebd8b66SMauro Carvalho Chehab
107*7ebd8b66SMauro Carvalho ChehabIn addition to the alarms described above, there is a CHAS alarm on the chips
108*7ebd8b66SMauro Carvalho Chehabwhich triggers if your computer case is open (This one is latched, contrary
109*7ebd8b66SMauro Carvalho Chehabto realtime alarms).
110*7ebd8b66SMauro Carvalho Chehab
111*7ebd8b66SMauro Carvalho ChehabThe chips only update values each 3 seconds; reading them more often will
112*7ebd8b66SMauro Carvalho Chehabdo no harm, but will return 'old' values.
113*7ebd8b66SMauro Carvalho Chehab
114*7ebd8b66SMauro Carvalho Chehab
115*7ebd8b66SMauro Carvalho ChehabW83792D PROBLEMS
116*7ebd8b66SMauro Carvalho Chehab----------------
117*7ebd8b66SMauro Carvalho ChehabKnown problems:
118*7ebd8b66SMauro Carvalho Chehab	- This driver is only for Winbond W83792D C version device, there
119*7ebd8b66SMauro Carvalho Chehab	  are also some motherboards with B version W83792D device. The
120*7ebd8b66SMauro Carvalho Chehab	  calculation method to in6-in7(measured value, limits) is a little
121*7ebd8b66SMauro Carvalho Chehab	  different between C and B version. C or B version can be identified
122*7ebd8b66SMauro Carvalho Chehab	  by CR[0x49h].
123*7ebd8b66SMauro Carvalho Chehab	- The function of vid and vrm has not been finished, because I'm NOT
124*7ebd8b66SMauro Carvalho Chehab	  very familiar with them. Adding support is welcome.
125*7ebd8b66SMauro Carvalho Chehab	- The function of chassis open detection needs more tests.
126*7ebd8b66SMauro Carvalho Chehab	- If you have ASUS server board and chip was not found: Then you will
127*7ebd8b66SMauro Carvalho Chehab	  need to upgrade to latest (or beta) BIOS. If it does not help please
128*7ebd8b66SMauro Carvalho Chehab	  contact us.
129*7ebd8b66SMauro Carvalho Chehab
130*7ebd8b66SMauro Carvalho ChehabFan control
131*7ebd8b66SMauro Carvalho Chehab-----------
132*7ebd8b66SMauro Carvalho Chehab
133*7ebd8b66SMauro Carvalho ChehabManual mode
134*7ebd8b66SMauro Carvalho Chehab-----------
135*7ebd8b66SMauro Carvalho Chehab
136*7ebd8b66SMauro Carvalho ChehabWorks as expected. You just need to specify desired PWM/DC value (fan speed)
137*7ebd8b66SMauro Carvalho Chehabin appropriate pwm# file.
138*7ebd8b66SMauro Carvalho Chehab
139*7ebd8b66SMauro Carvalho ChehabThermal cruise
140*7ebd8b66SMauro Carvalho Chehab--------------
141*7ebd8b66SMauro Carvalho Chehab
142*7ebd8b66SMauro Carvalho ChehabIn this mode, W83792D provides the Smart Fan system to automatically control
143*7ebd8b66SMauro Carvalho Chehabfan speed to keep the temperatures of CPU and the system within specific
144*7ebd8b66SMauro Carvalho Chehabrange. At first a wanted temperature and interval must be set. This is done
145*7ebd8b66SMauro Carvalho Chehabvia thermal_cruise# file. The tolerance# file serves to create T +- tolerance
146*7ebd8b66SMauro Carvalho Chehabinterval. The fan speed will be lowered as long as the current temperature
147*7ebd8b66SMauro Carvalho Chehabremains below the thermal_cruise# +- tolerance# value. Once the temperature
148*7ebd8b66SMauro Carvalho Chehabexceeds the high limit (T+tolerance), the fan will be turned on with a
149*7ebd8b66SMauro Carvalho Chehabspecific speed set by pwm# and automatically controlled its PWM duty cycle
150*7ebd8b66SMauro Carvalho Chehabwith the temperature varying. Three conditions may occur:
151*7ebd8b66SMauro Carvalho Chehab
152*7ebd8b66SMauro Carvalho Chehab(1) If the temperature still exceeds the high limit, PWM duty
153*7ebd8b66SMauro Carvalho Chehabcycle will increase slowly.
154*7ebd8b66SMauro Carvalho Chehab
155*7ebd8b66SMauro Carvalho Chehab(2) If the temperature goes below the high limit, but still above the low
156*7ebd8b66SMauro Carvalho Chehablimit (T-tolerance), the fan speed will be fixed at the current speed because
157*7ebd8b66SMauro Carvalho Chehabthe temperature is in the target range.
158*7ebd8b66SMauro Carvalho Chehab
159*7ebd8b66SMauro Carvalho Chehab(3) If the temperature goes below the low limit, PWM duty cycle will decrease
160*7ebd8b66SMauro Carvalho Chehabslowly to 0 or a preset stop value until the temperature exceeds the low
161*7ebd8b66SMauro Carvalho Chehablimit. (The preset stop value handling is not yet implemented in driver)
162*7ebd8b66SMauro Carvalho Chehab
163*7ebd8b66SMauro Carvalho ChehabSmart Fan II
164*7ebd8b66SMauro Carvalho Chehab------------
165*7ebd8b66SMauro Carvalho Chehab
166*7ebd8b66SMauro Carvalho ChehabW83792D also provides a special mode for fan. Four temperature points are
167*7ebd8b66SMauro Carvalho Chehabavailable. When related temperature sensors detects the temperature in preset
168*7ebd8b66SMauro Carvalho Chehabtemperature region (sf2_point@_fan# +- tolerance#) it will cause fans to run
169*7ebd8b66SMauro Carvalho Chehabon programmed value from sf2_level@_fan#. You need to set four temperatures
170*7ebd8b66SMauro Carvalho Chehabfor each fan.
171*7ebd8b66SMauro Carvalho Chehab
172*7ebd8b66SMauro Carvalho Chehab
173*7ebd8b66SMauro Carvalho Chehab/sys files
174*7ebd8b66SMauro Carvalho Chehab----------
175*7ebd8b66SMauro Carvalho Chehab
176*7ebd8b66SMauro Carvalho Chehabpwm[1-7]
177*7ebd8b66SMauro Carvalho Chehab	- this file stores PWM duty cycle or DC value (fan speed) in range:
178*7ebd8b66SMauro Carvalho Chehab
179*7ebd8b66SMauro Carvalho Chehab	    0 (stop) to 255 (full)
180*7ebd8b66SMauro Carvalho Chehabpwm[1-3]_enable
181*7ebd8b66SMauro Carvalho Chehab	- this file controls mode of fan/temperature control:
182*7ebd8b66SMauro Carvalho Chehab
183*7ebd8b66SMauro Carvalho Chehab	    * 0 Disabled
184*7ebd8b66SMauro Carvalho Chehab	    * 1 Manual mode
185*7ebd8b66SMauro Carvalho Chehab	    * 2 Smart Fan II
186*7ebd8b66SMauro Carvalho Chehab	    * 3 Thermal Cruise
187*7ebd8b66SMauro Carvalho Chehabpwm[1-7]_mode
188*7ebd8b66SMauro Carvalho Chehab	- Select PWM or DC mode
189*7ebd8b66SMauro Carvalho Chehab
190*7ebd8b66SMauro Carvalho Chehab	    * 0 DC
191*7ebd8b66SMauro Carvalho Chehab	    * 1 PWM
192*7ebd8b66SMauro Carvalho Chehabthermal_cruise[1-3]
193*7ebd8b66SMauro Carvalho Chehab	- Selects the desired temperature for cruise (degC)
194*7ebd8b66SMauro Carvalho Chehabtolerance[1-3]
195*7ebd8b66SMauro Carvalho Chehab	- Value in degrees of Celsius (degC) for +- T
196*7ebd8b66SMauro Carvalho Chehabsf2_point[1-4]_fan[1-3]
197*7ebd8b66SMauro Carvalho Chehab	- four temperature points for each fan for Smart Fan II
198*7ebd8b66SMauro Carvalho Chehabsf2_level[1-3]_fan[1-3]
199*7ebd8b66SMauro Carvalho Chehab	- three PWM/DC levels for each fan for Smart Fan II
200