17f15b664SR.Marek@sh.cvut.czKernel driver adm1026 27f15b664SR.Marek@sh.cvut.cz===================== 37f15b664SR.Marek@sh.cvut.cz 47f15b664SR.Marek@sh.cvut.czSupported chips: 57f15b664SR.Marek@sh.cvut.cz * Analog Devices ADM1026 6b04f2f7dSMauro Carvalho Chehab 77f15b664SR.Marek@sh.cvut.cz Prefix: 'adm1026' 8b04f2f7dSMauro Carvalho Chehab 97f15b664SR.Marek@sh.cvut.cz Addresses scanned: I2C 0x2c, 0x2d, 0x2e 10b04f2f7dSMauro Carvalho Chehab 117f15b664SR.Marek@sh.cvut.cz Datasheet: Publicly available at the Analog Devices website 12b04f2f7dSMauro Carvalho Chehab 13*ad736c1aSAlexander A. Klimov https://www.onsemi.com/PowerSolutions/product.do?id=ADM1026 147f15b664SR.Marek@sh.cvut.cz 157f15b664SR.Marek@sh.cvut.czAuthors: 16b04f2f7dSMauro Carvalho Chehab - Philip Pokorny <ppokorny@penguincomputing.com> for Penguin Computing 17b04f2f7dSMauro Carvalho Chehab - Justin Thiessen <jthiessen@penguincomputing.com> 187f15b664SR.Marek@sh.cvut.cz 197f15b664SR.Marek@sh.cvut.czModule Parameters 207f15b664SR.Marek@sh.cvut.cz----------------- 217f15b664SR.Marek@sh.cvut.cz 227f15b664SR.Marek@sh.cvut.cz* gpio_input: int array (min = 1, max = 17) 237f15b664SR.Marek@sh.cvut.cz List of GPIO pins (0-16) to program as inputs 24b04f2f7dSMauro Carvalho Chehab 257f15b664SR.Marek@sh.cvut.cz* gpio_output: int array (min = 1, max = 17) 267f15b664SR.Marek@sh.cvut.cz List of GPIO pins (0-16) to program as outputs 27b04f2f7dSMauro Carvalho Chehab 287f15b664SR.Marek@sh.cvut.cz* gpio_inverted: int array (min = 1, max = 17) 297f15b664SR.Marek@sh.cvut.cz List of GPIO pins (0-16) to program as inverted 30b04f2f7dSMauro Carvalho Chehab 317f15b664SR.Marek@sh.cvut.cz* gpio_normal: int array (min = 1, max = 17) 327f15b664SR.Marek@sh.cvut.cz List of GPIO pins (0-16) to program as normal/non-inverted 33b04f2f7dSMauro Carvalho Chehab 347f15b664SR.Marek@sh.cvut.cz* gpio_fan: int array (min = 1, max = 8) 357f15b664SR.Marek@sh.cvut.cz List of GPIO pins (0-7) to program as fan tachs 367f15b664SR.Marek@sh.cvut.cz 377f15b664SR.Marek@sh.cvut.cz 387f15b664SR.Marek@sh.cvut.czDescription 397f15b664SR.Marek@sh.cvut.cz----------- 407f15b664SR.Marek@sh.cvut.cz 417f15b664SR.Marek@sh.cvut.czThis driver implements support for the Analog Devices ADM1026. Analog 427f15b664SR.Marek@sh.cvut.czDevices calls it a "complete thermal system management controller." 437f15b664SR.Marek@sh.cvut.cz 447f15b664SR.Marek@sh.cvut.czThe ADM1026 implements three (3) temperature sensors, 17 voltage sensors, 457f15b664SR.Marek@sh.cvut.cz16 general purpose digital I/O lines, eight (8) fan speed sensors (8-bit), 467f15b664SR.Marek@sh.cvut.czan analog output and a PWM output along with limit, alarm and mask bits for 477f15b664SR.Marek@sh.cvut.czall of the above. There is even 8k bytes of EEPROM memory on chip. 487f15b664SR.Marek@sh.cvut.cz 497f15b664SR.Marek@sh.cvut.czTemperatures are measured in degrees Celsius. There are two external 507f15b664SR.Marek@sh.cvut.czsensor inputs and one internal sensor. Each sensor has a high and low 517f15b664SR.Marek@sh.cvut.czlimit. If the limit is exceeded, an interrupt (#SMBALERT) can be 527f15b664SR.Marek@sh.cvut.czgenerated. The interrupts can be masked. In addition, there are over-temp 537f15b664SR.Marek@sh.cvut.czlimits for each sensor. If this limit is exceeded, the #THERM output will 547f15b664SR.Marek@sh.cvut.czbe asserted. The current temperature and limits have a resolution of 1 557f15b664SR.Marek@sh.cvut.czdegree. 567f15b664SR.Marek@sh.cvut.cz 577f15b664SR.Marek@sh.cvut.czFan rotation speeds are reported in RPM (rotations per minute) but measured 587f15b664SR.Marek@sh.cvut.czin counts of a 22.5kHz internal clock. Each fan has a high limit which 597f15b664SR.Marek@sh.cvut.czcorresponds to a minimum fan speed. If the limit is exceeded, an interrupt 607f15b664SR.Marek@sh.cvut.czcan be generated. Each fan can be programmed to divide the reference clock 617f15b664SR.Marek@sh.cvut.czby 1, 2, 4 or 8. Not all RPM values can accurately be represented, so some 627f15b664SR.Marek@sh.cvut.czrounding is done. With a divider of 8, the slowest measurable speed of a 637f15b664SR.Marek@sh.cvut.cztwo pulse per revolution fan is 661 RPM. 647f15b664SR.Marek@sh.cvut.cz 657f15b664SR.Marek@sh.cvut.czThere are 17 voltage sensors. An alarm is triggered if the voltage has 667f15b664SR.Marek@sh.cvut.czcrossed a programmable minimum or maximum limit. Note that minimum in this 677f15b664SR.Marek@sh.cvut.czcase always means 'closest to zero'; this is important for negative voltage 687f15b664SR.Marek@sh.cvut.czmeasurements. Several inputs have integrated attenuators so they can measure 697f15b664SR.Marek@sh.cvut.czhigher voltages directly. 3.3V, 5V, 12V, -12V and battery voltage all have 707f15b664SR.Marek@sh.cvut.czdedicated inputs. There are several inputs scaled to 0-3V full-scale range 717f15b664SR.Marek@sh.cvut.czfor SCSI terminator power. The remaining inputs are not scaled and have 727f15b664SR.Marek@sh.cvut.cza 0-2.5V full-scale range. A 2.5V or 1.82V reference voltage is provided 737f15b664SR.Marek@sh.cvut.czfor negative voltage measurements. 747f15b664SR.Marek@sh.cvut.cz 757f15b664SR.Marek@sh.cvut.czIf an alarm triggers, it will remain triggered until the hardware register 767f15b664SR.Marek@sh.cvut.czis read at least once. This means that the cause for the alarm may already 777f15b664SR.Marek@sh.cvut.czhave disappeared! Note that in the current implementation, all hardware 787f15b664SR.Marek@sh.cvut.czregisters are read whenever any data is read (unless it is less than 2.0 797f15b664SR.Marek@sh.cvut.czseconds since the last update). This means that you can easily miss 807f15b664SR.Marek@sh.cvut.czonce-only alarms. 817f15b664SR.Marek@sh.cvut.cz 827f15b664SR.Marek@sh.cvut.czThe ADM1026 measures continuously. Analog inputs are measured about 4 837f15b664SR.Marek@sh.cvut.cztimes a second. Fan speed measurement time depends on fan speed and 847f15b664SR.Marek@sh.cvut.czdivisor. It can take as long as 1.5 seconds to measure all fan speeds. 857f15b664SR.Marek@sh.cvut.cz 867f15b664SR.Marek@sh.cvut.czThe ADM1026 has the ability to automatically control fan speed based on the 877f15b664SR.Marek@sh.cvut.cztemperature sensor inputs. Both the PWM output and the DAC output can be 887f15b664SR.Marek@sh.cvut.czused to control fan speed. Usually only one of these two outputs will be 897f15b664SR.Marek@sh.cvut.czused. Write the minimum PWM or DAC value to the appropriate control 907f15b664SR.Marek@sh.cvut.czregister. Then set the low temperature limit in the tmin values for each 91be2a608bSJohn Anthony Kazos Jrtemperature sensor. The range of control is fixed at 20 °C, and the 927f15b664SR.Marek@sh.cvut.czlargest difference between current and tmin of the temperature sensors sets 937f15b664SR.Marek@sh.cvut.czthe control output. See the datasheet for several example circuits for 947f15b664SR.Marek@sh.cvut.czcontrolling fan speed with the PWM and DAC outputs. The fan speed sensors 957f15b664SR.Marek@sh.cvut.czdo not have PWM compensation, so it is probably best to control the fan 967f15b664SR.Marek@sh.cvut.czvoltage from the power lead rather than on the ground lead. 977f15b664SR.Marek@sh.cvut.cz 987f15b664SR.Marek@sh.cvut.czThe datasheet shows an example application with VID signals attached to 997f15b664SR.Marek@sh.cvut.czGPIO lines. Unfortunately, the chip may not be connected to the VID lines 1007f15b664SR.Marek@sh.cvut.czin this way. The driver assumes that the chips *is* connected this way to 1017f15b664SR.Marek@sh.cvut.czget a VID voltage. 102