1*4882a593SmuzhiyunKernel driver adm1026 2*4882a593Smuzhiyun===================== 3*4882a593Smuzhiyun 4*4882a593SmuzhiyunSupported chips: 5*4882a593Smuzhiyun * Analog Devices ADM1026 6*4882a593Smuzhiyun 7*4882a593Smuzhiyun Prefix: 'adm1026' 8*4882a593Smuzhiyun 9*4882a593Smuzhiyun Addresses scanned: I2C 0x2c, 0x2d, 0x2e 10*4882a593Smuzhiyun 11*4882a593Smuzhiyun Datasheet: Publicly available at the Analog Devices website 12*4882a593Smuzhiyun 13*4882a593Smuzhiyun https://www.onsemi.com/PowerSolutions/product.do?id=ADM1026 14*4882a593Smuzhiyun 15*4882a593SmuzhiyunAuthors: 16*4882a593Smuzhiyun - Philip Pokorny <ppokorny@penguincomputing.com> for Penguin Computing 17*4882a593Smuzhiyun - Justin Thiessen <jthiessen@penguincomputing.com> 18*4882a593Smuzhiyun 19*4882a593SmuzhiyunModule Parameters 20*4882a593Smuzhiyun----------------- 21*4882a593Smuzhiyun 22*4882a593Smuzhiyun* gpio_input: int array (min = 1, max = 17) 23*4882a593Smuzhiyun List of GPIO pins (0-16) to program as inputs 24*4882a593Smuzhiyun 25*4882a593Smuzhiyun* gpio_output: int array (min = 1, max = 17) 26*4882a593Smuzhiyun List of GPIO pins (0-16) to program as outputs 27*4882a593Smuzhiyun 28*4882a593Smuzhiyun* gpio_inverted: int array (min = 1, max = 17) 29*4882a593Smuzhiyun List of GPIO pins (0-16) to program as inverted 30*4882a593Smuzhiyun 31*4882a593Smuzhiyun* gpio_normal: int array (min = 1, max = 17) 32*4882a593Smuzhiyun List of GPIO pins (0-16) to program as normal/non-inverted 33*4882a593Smuzhiyun 34*4882a593Smuzhiyun* gpio_fan: int array (min = 1, max = 8) 35*4882a593Smuzhiyun List of GPIO pins (0-7) to program as fan tachs 36*4882a593Smuzhiyun 37*4882a593Smuzhiyun 38*4882a593SmuzhiyunDescription 39*4882a593Smuzhiyun----------- 40*4882a593Smuzhiyun 41*4882a593SmuzhiyunThis driver implements support for the Analog Devices ADM1026. Analog 42*4882a593SmuzhiyunDevices calls it a "complete thermal system management controller." 43*4882a593Smuzhiyun 44*4882a593SmuzhiyunThe ADM1026 implements three (3) temperature sensors, 17 voltage sensors, 45*4882a593Smuzhiyun16 general purpose digital I/O lines, eight (8) fan speed sensors (8-bit), 46*4882a593Smuzhiyunan analog output and a PWM output along with limit, alarm and mask bits for 47*4882a593Smuzhiyunall of the above. There is even 8k bytes of EEPROM memory on chip. 48*4882a593Smuzhiyun 49*4882a593SmuzhiyunTemperatures are measured in degrees Celsius. There are two external 50*4882a593Smuzhiyunsensor inputs and one internal sensor. Each sensor has a high and low 51*4882a593Smuzhiyunlimit. If the limit is exceeded, an interrupt (#SMBALERT) can be 52*4882a593Smuzhiyungenerated. The interrupts can be masked. In addition, there are over-temp 53*4882a593Smuzhiyunlimits for each sensor. If this limit is exceeded, the #THERM output will 54*4882a593Smuzhiyunbe asserted. The current temperature and limits have a resolution of 1 55*4882a593Smuzhiyundegree. 56*4882a593Smuzhiyun 57*4882a593SmuzhiyunFan rotation speeds are reported in RPM (rotations per minute) but measured 58*4882a593Smuzhiyunin counts of a 22.5kHz internal clock. Each fan has a high limit which 59*4882a593Smuzhiyuncorresponds to a minimum fan speed. If the limit is exceeded, an interrupt 60*4882a593Smuzhiyuncan be generated. Each fan can be programmed to divide the reference clock 61*4882a593Smuzhiyunby 1, 2, 4 or 8. Not all RPM values can accurately be represented, so some 62*4882a593Smuzhiyunrounding is done. With a divider of 8, the slowest measurable speed of a 63*4882a593Smuzhiyuntwo pulse per revolution fan is 661 RPM. 64*4882a593Smuzhiyun 65*4882a593SmuzhiyunThere are 17 voltage sensors. An alarm is triggered if the voltage has 66*4882a593Smuzhiyuncrossed a programmable minimum or maximum limit. Note that minimum in this 67*4882a593Smuzhiyuncase always means 'closest to zero'; this is important for negative voltage 68*4882a593Smuzhiyunmeasurements. Several inputs have integrated attenuators so they can measure 69*4882a593Smuzhiyunhigher voltages directly. 3.3V, 5V, 12V, -12V and battery voltage all have 70*4882a593Smuzhiyundedicated inputs. There are several inputs scaled to 0-3V full-scale range 71*4882a593Smuzhiyunfor SCSI terminator power. The remaining inputs are not scaled and have 72*4882a593Smuzhiyuna 0-2.5V full-scale range. A 2.5V or 1.82V reference voltage is provided 73*4882a593Smuzhiyunfor negative voltage measurements. 74*4882a593Smuzhiyun 75*4882a593SmuzhiyunIf an alarm triggers, it will remain triggered until the hardware register 76*4882a593Smuzhiyunis read at least once. This means that the cause for the alarm may already 77*4882a593Smuzhiyunhave disappeared! Note that in the current implementation, all hardware 78*4882a593Smuzhiyunregisters are read whenever any data is read (unless it is less than 2.0 79*4882a593Smuzhiyunseconds since the last update). This means that you can easily miss 80*4882a593Smuzhiyunonce-only alarms. 81*4882a593Smuzhiyun 82*4882a593SmuzhiyunThe ADM1026 measures continuously. Analog inputs are measured about 4 83*4882a593Smuzhiyuntimes a second. Fan speed measurement time depends on fan speed and 84*4882a593Smuzhiyundivisor. It can take as long as 1.5 seconds to measure all fan speeds. 85*4882a593Smuzhiyun 86*4882a593SmuzhiyunThe ADM1026 has the ability to automatically control fan speed based on the 87*4882a593Smuzhiyuntemperature sensor inputs. Both the PWM output and the DAC output can be 88*4882a593Smuzhiyunused to control fan speed. Usually only one of these two outputs will be 89*4882a593Smuzhiyunused. Write the minimum PWM or DAC value to the appropriate control 90*4882a593Smuzhiyunregister. Then set the low temperature limit in the tmin values for each 91*4882a593Smuzhiyuntemperature sensor. The range of control is fixed at 20 °C, and the 92*4882a593Smuzhiyunlargest difference between current and tmin of the temperature sensors sets 93*4882a593Smuzhiyunthe control output. See the datasheet for several example circuits for 94*4882a593Smuzhiyuncontrolling fan speed with the PWM and DAC outputs. The fan speed sensors 95*4882a593Smuzhiyundo not have PWM compensation, so it is probably best to control the fan 96*4882a593Smuzhiyunvoltage from the power lead rather than on the ground lead. 97*4882a593Smuzhiyun 98*4882a593SmuzhiyunThe datasheet shows an example application with VID signals attached to 99*4882a593SmuzhiyunGPIO lines. Unfortunately, the chip may not be connected to the VID lines 100*4882a593Smuzhiyunin this way. The driver assumes that the chips *is* connected this way to 101*4882a593Smuzhiyunget a VID voltage. 102