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 ina2xx
^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)   * Texas Instruments INA219
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)     Prefix: 'ina219'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)     Addresses: I2C 0x40 - 0x4f
^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 Texas Instruments website
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) 	       https://www.ti.com/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16)   * Texas Instruments INA220
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18)     Prefix: 'ina220'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20)     Addresses: I2C 0x40 - 0x4f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)     Datasheet: Publicly available at the Texas Instruments website
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 	       https://www.ti.com/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26)   * Texas Instruments INA226
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28)     Prefix: 'ina226'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30)     Addresses: I2C 0x40 - 0x4f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32)     Datasheet: Publicly available at the Texas Instruments website
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	       https://www.ti.com/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36)   * Texas Instruments INA230
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38)     Prefix: 'ina230'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40)     Addresses: I2C 0x40 - 0x4f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42)     Datasheet: Publicly available at the Texas Instruments website
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 	       https://www.ti.com/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46)   * Texas Instruments INA231
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48)     Prefix: 'ina231'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50)     Addresses: I2C 0x40 - 0x4f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52)     Datasheet: Publicly available at the Texas Instruments website
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	       https://www.ti.com/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) Author: Lothar Felten <lothar.felten@gmail.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) -----------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) The INA219 is a high-side current shunt and power monitor with an I2C
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) interface. The INA219 monitors both shunt drop and supply voltage, with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) programmable conversion times and filtering.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) The INA220 is a high or low side current shunt and power monitor with an I2C
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) interface. The INA220 monitors both shunt drop and supply voltage.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) The INA226 is a current shunt and power monitor with an I2C interface.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) The INA226 monitors both a shunt voltage drop and bus supply voltage.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) INA230 and INA231 are high or low side current shunt and power monitors
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) with an I2C interface. The chips monitor both a shunt voltage drop and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) bus supply voltage.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) The shunt value in micro-ohms can be set via platform data or device tree at
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) compile-time or via the shunt_resistor attribute in sysfs at run-time. Please
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) refer to the Documentation/devicetree/bindings/hwmon/ina2xx.txt for bindings
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) if the device tree is used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) Additionally ina226 supports update_interval attribute as described in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) Documentation/hwmon/sysfs-interface.rst. Internally the interval is the sum of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) bus and shunt voltage conversion times multiplied by the averaging rate. We
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) don't touch the conversion times and only modify the number of averages. The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) lower limit of the update_interval is 2 ms, the upper limit is 2253 ms.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) The actual programmed interval may vary from the desired value.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) General sysfs entries
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) ---------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) ======================= ===============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) in0_input		Shunt voltage(mV) channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) in1_input		Bus voltage(mV) channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) curr1_input		Current(mA) measurement channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) power1_input		Power(uW) measurement channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) shunt_resistor		Shunt resistance(uOhm) channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) ======================= ===============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) Sysfs entries for ina226, ina230 and ina231 only
^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) in0_lcrit		Critical low shunt voltage
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) in0_crit		Critical high shunt voltage
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) in0_lcrit_alarm		Shunt voltage critical low alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) in0_crit_alarm		Shunt voltage critical high alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) in1_lcrit		Critical low bus voltage
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) in1_crit		Critical high bus voltage
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) in1_lcrit_alarm		Bus voltage critical low alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) in1_crit_alarm		Bus voltage critical high alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) power1_crit		Critical high power
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) power1_crit_alarm	Power critical high alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) update_interval		data conversion time; affects number of samples used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 			to average results for shunt and bus voltages.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) ======================= ====================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) .. note::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)    - Configure `shunt_resistor` before configure `power1_crit`, because power
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)      value is calculated based on `shunt_resistor` set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)    - Because of the underlying register implementation, only one `*crit` setting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)      and its `alarm` can be active. Writing to one `*crit` setting clears other
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)      `*crit` settings and alarms. Writing 0 to any `*crit` setting clears all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123)      `*crit` settings and alarms.