128 lines · plain
1Kernel driver ina2xx2====================3 4Supported chips:5 6 * Texas Instruments INA2197 8 9 Prefix: 'ina219'10 Addresses: I2C 0x40 - 0x4f11 12 Datasheet: Publicly available at the Texas Instruments website13 14 https://www.ti.com/15 16 * Texas Instruments INA22017 18 Prefix: 'ina220'19 20 Addresses: I2C 0x40 - 0x4f21 22 Datasheet: Publicly available at the Texas Instruments website23 24 https://www.ti.com/25 26 * Texas Instruments INA22627 28 Prefix: 'ina226'29 30 Addresses: I2C 0x40 - 0x4f31 32 Datasheet: Publicly available at the Texas Instruments website33 34 https://www.ti.com/35 36 * Texas Instruments INA23037 38 Prefix: 'ina230'39 40 Addresses: I2C 0x40 - 0x4f41 42 Datasheet: Publicly available at the Texas Instruments website43 44 https://www.ti.com/45 46 * Texas Instruments INA23147 48 Prefix: 'ina231'49 50 Addresses: I2C 0x40 - 0x4f51 52 Datasheet: Publicly available at the Texas Instruments website53 54 https://www.ti.com/55 56Author: Lothar Felten <lothar.felten@gmail.com>57 58Description59-----------60 61The INA219 is a high-side current shunt and power monitor with an I2C62interface. The INA219 monitors both shunt drop and supply voltage, with63programmable conversion times and filtering.64 65The INA220 is a high or low side current shunt and power monitor with an I2C66interface. The INA220 monitors both shunt drop and supply voltage.67 68The INA226 is a current shunt and power monitor with an I2C interface.69The INA226 monitors both a shunt voltage drop and bus supply voltage.70 71INA230 and INA231 are high or low side current shunt and power monitors72with an I2C interface. The chips monitor both a shunt voltage drop and73bus supply voltage.74 75The shunt value in micro-ohms can be set via platform data or device tree at76compile-time or via the shunt_resistor attribute in sysfs at run-time. Please77refer to the Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml for bindings78if the device tree is used.79 80Additionally ina226 supports update_interval attribute as described in81Documentation/hwmon/sysfs-interface.rst. Internally the interval is the sum of82bus and shunt voltage conversion times multiplied by the averaging rate. We83don't touch the conversion times and only modify the number of averages. The84lower limit of the update_interval is 2 ms, the upper limit is 2253 ms.85The actual programmed interval may vary from the desired value.86 87General sysfs entries88---------------------89 90======================= ===============================91in0_input Shunt voltage(mV) channel92in1_input Bus voltage(mV) channel93curr1_input Current(mA) measurement channel94power1_input Power(uW) measurement channel95shunt_resistor Shunt resistance(uOhm) channel96======================= ===============================97 98Sysfs entries for ina226, ina230 and ina231 only99------------------------------------------------100 101======================= ====================================================102curr1_lcrit Critical low current103curr1_crit Critical high current104curr1_lcrit_alarm Current critical low alarm105curr1_crit_alarm Current critical high alarm106in0_lcrit Critical low shunt voltage107in0_crit Critical high shunt voltage108in0_lcrit_alarm Shunt voltage critical low alarm109in0_crit_alarm Shunt voltage critical high alarm110in1_lcrit Critical low bus voltage111in1_crit Critical high bus voltage112in1_lcrit_alarm Bus voltage critical low alarm113in1_crit_alarm Bus voltage critical high alarm114power1_crit Critical high power115power1_crit_alarm Power critical high alarm116update_interval data conversion time; affects number of samples used117 to average results for shunt and bus voltages.118======================= ====================================================119 120.. note::121 122 - Configure `shunt_resistor` before configure `power1_crit`, because power123 value is calculated based on `shunt_resistor` set.124 - Because of the underlying register implementation, only one `*crit` setting125 and its `alarm` can be active. Writing to one `*crit` setting clears other126 `*crit` settings and alarms. Writing 0 to any `*crit` setting clears all127 `*crit` settings and alarms.128