xref: /OK3568_Linux_fs/kernel/Documentation/hwmon/adt7470.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunKernel driver adt7470
2*4882a593Smuzhiyun=====================
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunSupported chips:
5*4882a593Smuzhiyun
6*4882a593Smuzhiyun  * Analog Devices ADT7470
7*4882a593Smuzhiyun
8*4882a593Smuzhiyun    Prefix: 'adt7470'
9*4882a593Smuzhiyun
10*4882a593Smuzhiyun    Addresses scanned: I2C 0x2C, 0x2E, 0x2F
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun    Datasheet: Publicly available at the Analog Devices website
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunAuthor: Darrick J. Wong
15*4882a593Smuzhiyun
16*4882a593SmuzhiyunDescription
17*4882a593Smuzhiyun-----------
18*4882a593Smuzhiyun
19*4882a593SmuzhiyunThis driver implements support for the Analog Devices ADT7470 chip.  There may
20*4882a593Smuzhiyunbe other chips that implement this interface.
21*4882a593Smuzhiyun
22*4882a593SmuzhiyunThe ADT7470 uses the 2-wire interface compatible with the SMBus 2.0
23*4882a593Smuzhiyunspecification. Using an analog to digital converter it measures up to ten (10)
24*4882a593Smuzhiyunexternal temperatures. It has four (4) 16-bit counters for measuring fan speed.
25*4882a593SmuzhiyunThere are four (4) PWM outputs that can be used to control fan speed.
26*4882a593Smuzhiyun
27*4882a593SmuzhiyunA sophisticated control system for the PWM outputs is designed into the ADT7470
28*4882a593Smuzhiyunthat allows fan speed to be adjusted automatically based on any of the ten
29*4882a593Smuzhiyuntemperature sensors. Each PWM output is individually adjustable and
30*4882a593Smuzhiyunprogrammable. Once configured, the ADT7470 will adjust the PWM outputs in
31*4882a593Smuzhiyunresponse to the measured temperatures with further host intervention.  This
32*4882a593Smuzhiyunfeature can also be disabled for manual control of the PWM's.
33*4882a593Smuzhiyun
34*4882a593SmuzhiyunEach of the measured inputs (temperature, fan speed) has corresponding high/low
35*4882a593Smuzhiyunlimit values. The ADT7470 will signal an ALARM if any measured value exceeds
36*4882a593Smuzhiyuneither limit.
37*4882a593Smuzhiyun
38*4882a593SmuzhiyunThe ADT7470 samples all inputs continuously.  A kernel thread is started up for
39*4882a593Smuzhiyunthe purpose of periodically querying the temperature sensors, thus allowing the
40*4882a593Smuzhiyunautomatic fan pwm control to set the fan speed.  The driver will not read the
41*4882a593Smuzhiyunregisters more often than once every 5 seconds.  Further, configuration data is
42*4882a593Smuzhiyunonly read once per minute.
43*4882a593Smuzhiyun
44*4882a593SmuzhiyunSpecial Features
45*4882a593Smuzhiyun----------------
46*4882a593Smuzhiyun
47*4882a593SmuzhiyunThe ADT7470 has a 8-bit ADC and is capable of measuring temperatures with 1
48*4882a593SmuzhiyundegC resolution.
49*4882a593Smuzhiyun
50*4882a593SmuzhiyunThe Analog Devices datasheet is very detailed and describes a procedure for
51*4882a593Smuzhiyundetermining an optimal configuration for the automatic PWM control.
52*4882a593Smuzhiyun
53*4882a593SmuzhiyunConfiguration Notes
54*4882a593Smuzhiyun-------------------
55*4882a593Smuzhiyun
56*4882a593SmuzhiyunBesides standard interfaces driver adds the following:
57*4882a593Smuzhiyun
58*4882a593Smuzhiyun* PWM Control
59*4882a593Smuzhiyun
60*4882a593Smuzhiyun* pwm#_auto_point1_pwm and pwm#_auto_point1_temp and
61*4882a593Smuzhiyun* pwm#_auto_point2_pwm and pwm#_auto_point2_temp -
62*4882a593Smuzhiyun
63*4882a593Smuzhiyun  - point1: Set the pwm speed at a lower temperature bound.
64*4882a593Smuzhiyun  - point2: Set the pwm speed at a higher temperature bound.
65*4882a593Smuzhiyun
66*4882a593SmuzhiyunThe ADT7470 will scale the pwm between the lower and higher pwm speed when
67*4882a593Smuzhiyunthe temperature is between the two temperature boundaries.  PWM values range
68*4882a593Smuzhiyunfrom 0 (off) to 255 (full speed).  Fan speed will be set to maximum when the
69*4882a593Smuzhiyuntemperature sensor associated with the PWM control exceeds
70*4882a593Smuzhiyunpwm#_auto_point2_temp.
71*4882a593Smuzhiyun
72*4882a593SmuzhiyunThe driver also allows control of the PWM frequency:
73*4882a593Smuzhiyun
74*4882a593Smuzhiyun* pwm1_freq
75*4882a593Smuzhiyun
76*4882a593SmuzhiyunThe PWM frequency is rounded to the nearest one of:
77*4882a593Smuzhiyun
78*4882a593Smuzhiyun* 11.0 Hz
79*4882a593Smuzhiyun* 14.7 Hz
80*4882a593Smuzhiyun* 22.1 Hz
81*4882a593Smuzhiyun* 29.4 Hz
82*4882a593Smuzhiyun* 35.3 Hz
83*4882a593Smuzhiyun* 44.1 Hz
84*4882a593Smuzhiyun* 58.8 Hz
85*4882a593Smuzhiyun* 88.2 Hz
86*4882a593Smuzhiyun* 1.4 kHz
87*4882a593Smuzhiyun* 22.5 kHz
88*4882a593Smuzhiyun
89*4882a593SmuzhiyunNotes
90*4882a593Smuzhiyun-----
91*4882a593Smuzhiyun
92*4882a593SmuzhiyunThe temperature inputs no longer need to be read periodically from userspace in
93*4882a593Smuzhiyunorder for the automatic pwm algorithm to run.  This was the case for earlier
94*4882a593Smuzhiyunversions of the driver.
95