Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) Kernel driver adt7475
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) =====================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) Supported chips:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)   * Analog Devices ADT7473
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)     Prefix: 'adt7473'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)     Addresses scanned: I2C 0x2C, 0x2D, 0x2E
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12)     Datasheet: Publicly available at the On Semiconductors website
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14)   * Analog Devices ADT7475
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16)     Prefix: 'adt7475'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18)     Addresses scanned: I2C 0x2E
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20)     Datasheet: Publicly available at the On Semiconductors website
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)   * Analog Devices ADT7476
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24)     Prefix: 'adt7476'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26)     Addresses scanned: I2C 0x2C, 0x2D, 0x2E
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28)     Datasheet: Publicly available at the On Semiconductors website
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30)   * Analog Devices ADT7490
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32)     Prefix: 'adt7490'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34)     Addresses scanned: I2C 0x2C, 0x2D, 0x2E
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36)     Datasheet: Publicly available at the On Semiconductors website
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) Authors:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 	- Jordan Crouse
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	- Hans de Goede
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 	- Darrick J. Wong (documentation)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 	- Jean Delvare
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) -----------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) This driver implements support for the Analog Devices ADT7473, ADT7475,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) ADT7476 and ADT7490 chip family. The ADT7473 and ADT7475 differ only in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) minor details. The ADT7476 has additional features, including extra voltage
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) measurement inputs and VID support. The ADT7490 also has additional
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) features, including extra voltage measurement inputs and PECI support. All
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) the supported chips will be collectively designed by the name "ADT747x" in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) the rest of this document.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) The ADT747x uses the 2-wire interface compatible with the SMBus 2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) specification. Using an analog to digital converter it measures three (3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) temperatures and two (2) or more voltages. It has four (4) 16-bit counters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) for measuring fan speed. There are three (3) PWM outputs that can be used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) to control fan speed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) A sophisticated control system for the PWM outputs is designed into the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) ADT747x that allows fan speed to be adjusted automatically based on any of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) three temperature sensors. Each PWM output is individually adjustable and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) programmable. Once configured, the ADT747x will adjust the PWM outputs in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) response to the measured temperatures without further host intervention.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) This feature can also be disabled for manual control of the PWM's.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) Each of the measured inputs (voltage, temperature, fan speed) has
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) corresponding high/low limit values. The ADT747x will signal an ALARM if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) any measured value exceeds either limit.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) The ADT747x samples all inputs continuously. The driver will not read
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) the registers more often than once every other second. Further,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) configuration data is only read once per minute.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) Chip Differences Summary
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) ------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) ADT7473:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81)   * 2 voltage inputs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82)   * system acoustics optimizations (not implemented)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) ADT7475:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85)   * 2 voltage inputs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) ADT7476:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88)   * 5 voltage inputs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89)   * VID support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) ADT7490:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92)   * 6 voltage inputs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93)   * 1 Imon input (not implemented)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94)   * PECI support (not implemented)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95)   * 2 GPIO pins (not implemented)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96)   * system acoustics optimizations (not implemented)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) Sysfs Mapping
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) -------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) ==== =========== =========== ========= ==========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) in   ADT7490     ADT7476     ADT7475   ADT7473
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) ==== =========== =========== ========= ==========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) in0  2.5VIN (22) 2.5VIN (22) -         -
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) in1  VCCP   (23) VCCP   (23) VCCP (14) VCCP (14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) in2  VCC    (4)  VCC    (4)  VCC  (4)  VCC  (3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) in3  5VIN   (20) 5VIN   (20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) in4  12VIN  (21) 12VIN  (21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) in5  VTT    (8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) ==== =========== =========== ========= ==========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) Special Features
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) ----------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) The ADT747x has a 10-bit ADC and can therefore measure temperatures
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) with a resolution of 0.25 degree Celsius. Temperature readings can be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) configured either for two's complement format or "Offset 64" format,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) wherein 64 is subtracted from the raw value to get the temperature value.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) The datasheet is very detailed and describes a procedure for determining
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) an optimal configuration for the automatic PWM control.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) Fan Speed Control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) -----------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) The driver exposes two trip points per PWM channel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) - point1: Set the PWM speed at the lower temperature bound
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) - point2: Set the PWM speed at the higher temperature bound
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) The ADT747x will scale the PWM linearly between the lower and higher PWM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) speed when the temperature is between the two temperature boundaries.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) Temperature boundaries are associated to temperature channels rather than
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) PWM outputs, and a given PWM output can be controlled by several temperature
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) channels. As a result, the ADT747x may compute more than one PWM value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) for a channel at a given time, in which case the maximum value (fastest
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) fan speed) is applied. PWM values range from 0 (off) to 255 (full speed).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) Fan speed may be set to maximum when the temperature sensor associated with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) the PWM control exceeds temp#_max.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) At Tmin - hysteresis the PWM output can either be off (0% duty cycle) or at the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) minimum (i.e. auto_point1_pwm). This behaviour can be configured using the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) `pwm[1-*]_stall_disable sysfs attribute`. A value of 0 means the fans will shut
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) off. A value of 1 means the fans will run at auto_point1_pwm.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) The responsiveness of the ADT747x to temperature changes can be configured.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) This allows smoothing of the fan speed transition. To set the transition time
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) set the value in ms in the `temp[1-*]_smoothing` sysfs attribute.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) Notes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) -----
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) The nVidia binary driver presents an ADT7473 chip via an on-card i2c bus.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) Unfortunately, they fail to set the i2c adapter class, so this driver may
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) fail to find the chip until the nvidia driver is patched.