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