17ebd8b66SMauro Carvalho ChehabKernel driver adt7470
27ebd8b66SMauro Carvalho Chehab=====================
37ebd8b66SMauro Carvalho Chehab
47ebd8b66SMauro Carvalho ChehabSupported chips:
57ebd8b66SMauro Carvalho Chehab
67ebd8b66SMauro Carvalho Chehab  * Analog Devices ADT7470
77ebd8b66SMauro Carvalho Chehab
87ebd8b66SMauro Carvalho Chehab    Prefix: 'adt7470'
97ebd8b66SMauro Carvalho Chehab
107ebd8b66SMauro Carvalho Chehab    Addresses scanned: I2C 0x2C, 0x2E, 0x2F
117ebd8b66SMauro Carvalho Chehab
127ebd8b66SMauro Carvalho Chehab    Datasheet: Publicly available at the Analog Devices website
137ebd8b66SMauro Carvalho Chehab
147ebd8b66SMauro Carvalho ChehabAuthor: Darrick J. Wong
157ebd8b66SMauro Carvalho Chehab
167ebd8b66SMauro Carvalho ChehabDescription
177ebd8b66SMauro Carvalho Chehab-----------
187ebd8b66SMauro Carvalho Chehab
197ebd8b66SMauro Carvalho ChehabThis driver implements support for the Analog Devices ADT7470 chip.  There may
207ebd8b66SMauro Carvalho Chehabbe other chips that implement this interface.
217ebd8b66SMauro Carvalho Chehab
227ebd8b66SMauro Carvalho ChehabThe ADT7470 uses the 2-wire interface compatible with the SMBus 2.0
237ebd8b66SMauro Carvalho Chehabspecification. Using an analog to digital converter it measures up to ten (10)
247ebd8b66SMauro Carvalho Chehabexternal temperatures. It has four (4) 16-bit counters for measuring fan speed.
257ebd8b66SMauro Carvalho ChehabThere are four (4) PWM outputs that can be used to control fan speed.
267ebd8b66SMauro Carvalho Chehab
277ebd8b66SMauro Carvalho ChehabA sophisticated control system for the PWM outputs is designed into the ADT7470
287ebd8b66SMauro Carvalho Chehabthat allows fan speed to be adjusted automatically based on any of the ten
297ebd8b66SMauro Carvalho Chehabtemperature sensors. Each PWM output is individually adjustable and
307ebd8b66SMauro Carvalho Chehabprogrammable. Once configured, the ADT7470 will adjust the PWM outputs in
317ebd8b66SMauro Carvalho Chehabresponse to the measured temperatures with further host intervention.  This
327ebd8b66SMauro Carvalho Chehabfeature can also be disabled for manual control of the PWM's.
337ebd8b66SMauro Carvalho Chehab
347ebd8b66SMauro Carvalho ChehabEach of the measured inputs (temperature, fan speed) has corresponding high/low
357ebd8b66SMauro Carvalho Chehablimit values. The ADT7470 will signal an ALARM if any measured value exceeds
367ebd8b66SMauro Carvalho Chehabeither limit.
377ebd8b66SMauro Carvalho Chehab
387ebd8b66SMauro Carvalho ChehabThe ADT7470 samples all inputs continuously.  A kernel thread is started up for
397ebd8b66SMauro Carvalho Chehabthe purpose of periodically querying the temperature sensors, thus allowing the
407ebd8b66SMauro Carvalho Chehabautomatic fan pwm control to set the fan speed.  The driver will not read the
417ebd8b66SMauro Carvalho Chehabregisters more often than once every 5 seconds.  Further, configuration data is
427ebd8b66SMauro Carvalho Chehabonly read once per minute.
437ebd8b66SMauro Carvalho Chehab
447ebd8b66SMauro Carvalho ChehabSpecial Features
457ebd8b66SMauro Carvalho Chehab----------------
467ebd8b66SMauro Carvalho Chehab
477ebd8b66SMauro Carvalho ChehabThe ADT7470 has a 8-bit ADC and is capable of measuring temperatures with 1
487ebd8b66SMauro Carvalho ChehabdegC resolution.
497ebd8b66SMauro Carvalho Chehab
507ebd8b66SMauro Carvalho ChehabThe Analog Devices datasheet is very detailed and describes a procedure for
517ebd8b66SMauro Carvalho Chehabdetermining an optimal configuration for the automatic PWM control.
527ebd8b66SMauro Carvalho Chehab
537ebd8b66SMauro Carvalho ChehabConfiguration Notes
547ebd8b66SMauro Carvalho Chehab-------------------
557ebd8b66SMauro Carvalho Chehab
567ebd8b66SMauro Carvalho ChehabBesides standard interfaces driver adds the following:
577ebd8b66SMauro Carvalho Chehab
587ebd8b66SMauro Carvalho Chehab* PWM Control
597ebd8b66SMauro Carvalho Chehab
607ebd8b66SMauro Carvalho Chehab* pwm#_auto_point1_pwm and pwm#_auto_point1_temp and
617ebd8b66SMauro Carvalho Chehab* pwm#_auto_point2_pwm and pwm#_auto_point2_temp -
627ebd8b66SMauro Carvalho Chehab
637ebd8b66SMauro Carvalho Chehab  - point1: Set the pwm speed at a lower temperature bound.
647ebd8b66SMauro Carvalho Chehab  - point2: Set the pwm speed at a higher temperature bound.
657ebd8b66SMauro Carvalho Chehab
667ebd8b66SMauro Carvalho ChehabThe ADT7470 will scale the pwm between the lower and higher pwm speed when
677ebd8b66SMauro Carvalho Chehabthe temperature is between the two temperature boundaries.  PWM values range
687ebd8b66SMauro Carvalho Chehabfrom 0 (off) to 255 (full speed).  Fan speed will be set to maximum when the
697ebd8b66SMauro Carvalho Chehabtemperature sensor associated with the PWM control exceeds
707ebd8b66SMauro Carvalho Chehabpwm#_auto_point2_temp.
717ebd8b66SMauro Carvalho Chehab
727ebd8b66SMauro Carvalho ChehabThe driver also allows control of the PWM frequency:
737ebd8b66SMauro Carvalho Chehab
747ebd8b66SMauro Carvalho Chehab* pwm1_freq
757ebd8b66SMauro Carvalho Chehab
767ebd8b66SMauro Carvalho ChehabThe PWM frequency is rounded to the nearest one of:
777ebd8b66SMauro Carvalho Chehab
787ebd8b66SMauro Carvalho Chehab* 11.0 Hz
797ebd8b66SMauro Carvalho Chehab* 14.7 Hz
807ebd8b66SMauro Carvalho Chehab* 22.1 Hz
817ebd8b66SMauro Carvalho Chehab* 29.4 Hz
827ebd8b66SMauro Carvalho Chehab* 35.3 Hz
837ebd8b66SMauro Carvalho Chehab* 44.1 Hz
847ebd8b66SMauro Carvalho Chehab* 58.8 Hz
857ebd8b66SMauro Carvalho Chehab* 88.2 Hz
867ebd8b66SMauro Carvalho Chehab* 1.4 kHz
877ebd8b66SMauro Carvalho Chehab* 22.5 kHz
887ebd8b66SMauro Carvalho Chehab
897ebd8b66SMauro Carvalho ChehabNotes
907ebd8b66SMauro Carvalho Chehab-----
917ebd8b66SMauro Carvalho Chehab
927ebd8b66SMauro Carvalho ChehabThe temperature inputs no longer need to be read periodically from userspace in
937ebd8b66SMauro Carvalho Chehaborder for the automatic pwm algorithm to run.  This was the case for earlier
947ebd8b66SMauro Carvalho Chehabversions of the driver.
95