xref: /OK3568_Linux_fs/kernel/Documentation/hwmon/w83792d.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunKernel driver w83792d
2*4882a593Smuzhiyun=====================
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunSupported chips:
5*4882a593Smuzhiyun
6*4882a593Smuzhiyun  * Winbond W83792D
7*4882a593Smuzhiyun
8*4882a593Smuzhiyun    Prefix: 'w83792d'
9*4882a593Smuzhiyun
10*4882a593Smuzhiyun    Addresses scanned: I2C 0x2c - 0x2f
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun    Datasheet: http://www.winbond.com.tw
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunAuthor: Shane Huang (Winbond)
15*4882a593SmuzhiyunUpdated: Roger Lucas
16*4882a593Smuzhiyun
17*4882a593Smuzhiyun
18*4882a593SmuzhiyunModule Parameters
19*4882a593Smuzhiyun-----------------
20*4882a593Smuzhiyun
21*4882a593Smuzhiyun* init int
22*4882a593Smuzhiyun    (default 1)
23*4882a593Smuzhiyun
24*4882a593Smuzhiyun    Use 'init=0' to bypass initializing the chip.
25*4882a593Smuzhiyun    Try this if your computer crashes when you load the module.
26*4882a593Smuzhiyun
27*4882a593Smuzhiyun* force_subclients=bus,caddr,saddr,saddr
28*4882a593Smuzhiyun    This is used to force the i2c addresses for subclients of
29*4882a593Smuzhiyun    a certain chip. Example usage is `force_subclients=0,0x2f,0x4a,0x4b`
30*4882a593Smuzhiyun    to force the subclients of chip 0x2f on bus 0 to i2c addresses
31*4882a593Smuzhiyun    0x4a and 0x4b.
32*4882a593Smuzhiyun
33*4882a593Smuzhiyun
34*4882a593SmuzhiyunDescription
35*4882a593Smuzhiyun-----------
36*4882a593Smuzhiyun
37*4882a593SmuzhiyunThis driver implements support for the Winbond W83792AD/D.
38*4882a593Smuzhiyun
39*4882a593SmuzhiyunDetection of the chip can sometimes be foiled because it can be in an
40*4882a593Smuzhiyuninternal state that allows no clean access (Bank with ID register is not
41*4882a593Smuzhiyuncurrently selected). If you know the address of the chip, use a 'force'
42*4882a593Smuzhiyunparameter; this will put it into a more well-behaved state first.
43*4882a593Smuzhiyun
44*4882a593SmuzhiyunThe driver implements three temperature sensors, seven fan rotation speed
45*4882a593Smuzhiyunsensors, nine voltage sensors, and two automatic fan regulation
46*4882a593Smuzhiyunstrategies called: Smart Fan I (Thermal Cruise mode) and Smart Fan II.
47*4882a593Smuzhiyun
48*4882a593SmuzhiyunThe driver also implements up to seven fan control outputs: pwm1-7.  Pwm1-7
49*4882a593Smuzhiyuncan be configured to PWM output or Analogue DC output via their associated
50*4882a593SmuzhiyunpwmX_mode. Outputs pwm4 through pwm7 may or may not be present depending on
51*4882a593Smuzhiyunhow the W83792AD/D was configured by the BIOS.
52*4882a593Smuzhiyun
53*4882a593SmuzhiyunAutomatic fan control mode is possible only for fan1-fan3.
54*4882a593Smuzhiyun
55*4882a593SmuzhiyunFor all pwmX outputs, a value of 0 means minimum fan speed and a value of
56*4882a593Smuzhiyun255 means maximum fan speed.
57*4882a593Smuzhiyun
58*4882a593SmuzhiyunTemperatures are measured in degrees Celsius and measurement resolution is 1
59*4882a593SmuzhiyundegC for temp1 and 0.5 degC for temp2 and temp3. An alarm is triggered when
60*4882a593Smuzhiyunthe temperature gets higher than the Overtemperature Shutdown value; it stays
61*4882a593Smuzhiyunon until the temperature falls below the Hysteresis value.
62*4882a593Smuzhiyun
63*4882a593SmuzhiyunFan rotation speeds are reported in RPM (rotations per minute). An alarm is
64*4882a593Smuzhiyuntriggered if the rotation speed has dropped below a programmable limit. Fan
65*4882a593Smuzhiyunreadings can be divided by a programmable divider (1, 2, 4, 8, 16, 32, 64 or
66*4882a593Smuzhiyun128) to give the readings more range or accuracy.
67*4882a593Smuzhiyun
68*4882a593SmuzhiyunVoltage sensors (also known as IN sensors) report their values in millivolts.
69*4882a593SmuzhiyunAn alarm is triggered if the voltage has crossed a programmable minimum
70*4882a593Smuzhiyunor maximum limit.
71*4882a593Smuzhiyun
72*4882a593SmuzhiyunAlarms are provided as output from "realtime status register". Following bits
73*4882a593Smuzhiyunare defined:
74*4882a593Smuzhiyun
75*4882a593Smuzhiyun==== ==========
76*4882a593Smuzhiyunbit   alarm on
77*4882a593Smuzhiyun==== ==========
78*4882a593Smuzhiyun0    in0
79*4882a593Smuzhiyun1    in1
80*4882a593Smuzhiyun2    temp1
81*4882a593Smuzhiyun3    temp2
82*4882a593Smuzhiyun4    temp3
83*4882a593Smuzhiyun5    fan1
84*4882a593Smuzhiyun6    fan2
85*4882a593Smuzhiyun7    fan3
86*4882a593Smuzhiyun8    in2
87*4882a593Smuzhiyun9    in3
88*4882a593Smuzhiyun10   in4
89*4882a593Smuzhiyun11   in5
90*4882a593Smuzhiyun12   in6
91*4882a593Smuzhiyun13   VID change
92*4882a593Smuzhiyun14   chassis
93*4882a593Smuzhiyun15   fan7
94*4882a593Smuzhiyun16   tart1
95*4882a593Smuzhiyun17   tart2
96*4882a593Smuzhiyun18   tart3
97*4882a593Smuzhiyun19   in7
98*4882a593Smuzhiyun20   in8
99*4882a593Smuzhiyun21   fan4
100*4882a593Smuzhiyun22   fan5
101*4882a593Smuzhiyun23   fan6
102*4882a593Smuzhiyun==== ==========
103*4882a593Smuzhiyun
104*4882a593SmuzhiyunTart will be asserted while target temperature cannot be achieved after 3 minutes
105*4882a593Smuzhiyunof full speed rotation of corresponding fan.
106*4882a593Smuzhiyun
107*4882a593SmuzhiyunIn addition to the alarms described above, there is a CHAS alarm on the chips
108*4882a593Smuzhiyunwhich triggers if your computer case is open (This one is latched, contrary
109*4882a593Smuzhiyunto realtime alarms).
110*4882a593Smuzhiyun
111*4882a593SmuzhiyunThe chips only update values each 3 seconds; reading them more often will
112*4882a593Smuzhiyundo no harm, but will return 'old' values.
113*4882a593Smuzhiyun
114*4882a593Smuzhiyun
115*4882a593SmuzhiyunW83792D PROBLEMS
116*4882a593Smuzhiyun----------------
117*4882a593SmuzhiyunKnown problems:
118*4882a593Smuzhiyun	- This driver is only for Winbond W83792D C version device, there
119*4882a593Smuzhiyun	  are also some motherboards with B version W83792D device. The
120*4882a593Smuzhiyun	  calculation method to in6-in7(measured value, limits) is a little
121*4882a593Smuzhiyun	  different between C and B version. C or B version can be identified
122*4882a593Smuzhiyun	  by CR[0x49h].
123*4882a593Smuzhiyun	- The function of vid and vrm has not been finished, because I'm NOT
124*4882a593Smuzhiyun	  very familiar with them. Adding support is welcome.
125*4882a593Smuzhiyun	- The function of chassis open detection needs more tests.
126*4882a593Smuzhiyun	- If you have ASUS server board and chip was not found: Then you will
127*4882a593Smuzhiyun	  need to upgrade to latest (or beta) BIOS. If it does not help please
128*4882a593Smuzhiyun	  contact us.
129*4882a593Smuzhiyun
130*4882a593SmuzhiyunFan control
131*4882a593Smuzhiyun-----------
132*4882a593Smuzhiyun
133*4882a593SmuzhiyunManual mode
134*4882a593Smuzhiyun-----------
135*4882a593Smuzhiyun
136*4882a593SmuzhiyunWorks as expected. You just need to specify desired PWM/DC value (fan speed)
137*4882a593Smuzhiyunin appropriate pwm# file.
138*4882a593Smuzhiyun
139*4882a593SmuzhiyunThermal cruise
140*4882a593Smuzhiyun--------------
141*4882a593Smuzhiyun
142*4882a593SmuzhiyunIn this mode, W83792D provides the Smart Fan system to automatically control
143*4882a593Smuzhiyunfan speed to keep the temperatures of CPU and the system within specific
144*4882a593Smuzhiyunrange. At first a wanted temperature and interval must be set. This is done
145*4882a593Smuzhiyunvia thermal_cruise# file. The tolerance# file serves to create T +- tolerance
146*4882a593Smuzhiyuninterval. The fan speed will be lowered as long as the current temperature
147*4882a593Smuzhiyunremains below the thermal_cruise# +- tolerance# value. Once the temperature
148*4882a593Smuzhiyunexceeds the high limit (T+tolerance), the fan will be turned on with a
149*4882a593Smuzhiyunspecific speed set by pwm# and automatically controlled its PWM duty cycle
150*4882a593Smuzhiyunwith the temperature varying. Three conditions may occur:
151*4882a593Smuzhiyun
152*4882a593Smuzhiyun(1) If the temperature still exceeds the high limit, PWM duty
153*4882a593Smuzhiyuncycle will increase slowly.
154*4882a593Smuzhiyun
155*4882a593Smuzhiyun(2) If the temperature goes below the high limit, but still above the low
156*4882a593Smuzhiyunlimit (T-tolerance), the fan speed will be fixed at the current speed because
157*4882a593Smuzhiyunthe temperature is in the target range.
158*4882a593Smuzhiyun
159*4882a593Smuzhiyun(3) If the temperature goes below the low limit, PWM duty cycle will decrease
160*4882a593Smuzhiyunslowly to 0 or a preset stop value until the temperature exceeds the low
161*4882a593Smuzhiyunlimit. (The preset stop value handling is not yet implemented in driver)
162*4882a593Smuzhiyun
163*4882a593SmuzhiyunSmart Fan II
164*4882a593Smuzhiyun------------
165*4882a593Smuzhiyun
166*4882a593SmuzhiyunW83792D also provides a special mode for fan. Four temperature points are
167*4882a593Smuzhiyunavailable. When related temperature sensors detects the temperature in preset
168*4882a593Smuzhiyuntemperature region (sf2_point@_fan# +- tolerance#) it will cause fans to run
169*4882a593Smuzhiyunon programmed value from sf2_level@_fan#. You need to set four temperatures
170*4882a593Smuzhiyunfor each fan.
171*4882a593Smuzhiyun
172*4882a593Smuzhiyun
173*4882a593Smuzhiyun/sys files
174*4882a593Smuzhiyun----------
175*4882a593Smuzhiyun
176*4882a593Smuzhiyunpwm[1-7]
177*4882a593Smuzhiyun	- this file stores PWM duty cycle or DC value (fan speed) in range:
178*4882a593Smuzhiyun
179*4882a593Smuzhiyun	    0 (stop) to 255 (full)
180*4882a593Smuzhiyunpwm[1-3]_enable
181*4882a593Smuzhiyun	- this file controls mode of fan/temperature control:
182*4882a593Smuzhiyun
183*4882a593Smuzhiyun	    * 0 Disabled
184*4882a593Smuzhiyun	    * 1 Manual mode
185*4882a593Smuzhiyun	    * 2 Smart Fan II
186*4882a593Smuzhiyun	    * 3 Thermal Cruise
187*4882a593Smuzhiyunpwm[1-7]_mode
188*4882a593Smuzhiyun	- Select PWM or DC mode
189*4882a593Smuzhiyun
190*4882a593Smuzhiyun	    * 0 DC
191*4882a593Smuzhiyun	    * 1 PWM
192*4882a593Smuzhiyunthermal_cruise[1-3]
193*4882a593Smuzhiyun	- Selects the desired temperature for cruise (degC)
194*4882a593Smuzhiyuntolerance[1-3]
195*4882a593Smuzhiyun	- Value in degrees of Celsius (degC) for +- T
196*4882a593Smuzhiyunsf2_point[1-4]_fan[1-3]
197*4882a593Smuzhiyun	- four temperature points for each fan for Smart Fan II
198*4882a593Smuzhiyunsf2_level[1-3]_fan[1-3]
199*4882a593Smuzhiyun	- three PWM/DC levels for each fan for Smart Fan II
200