Kernel driver ina2xx

Supported chips:

  • Texas Instruments INA219

    Prefix: ‘ina219’Addresses: I2C 0x40 - 0x4f

    Datasheet: Publicly available at the Texas Instruments website

  • Texas Instruments INA220

    Prefix: ‘ina220’

    Addresses: I2C 0x40 - 0x4f

    Datasheet: Publicly available at the Texas Instruments website

  • Texas Instruments INA226

    Prefix: ‘ina226’

    Addresses: I2C 0x40 - 0x4f

    Datasheet: Publicly available at the Texas Instruments website

  • Texas Instruments INA230

    Prefix: ‘ina230’

    Addresses: I2C 0x40 - 0x4f

    Datasheet: Publicly available at the Texas Instruments website

  • Texas Instruments INA231

    Prefix: ‘ina231’

    Addresses: I2C 0x40 - 0x4f

    Datasheet: Publicly available at the Texas Instruments website

Author: Lothar Felten <lothar.felten@gmail.com>

Description

The INA219 is a high-side current shunt and power monitor with an I2Cinterface. The INA219 monitors both shunt drop and supply voltage, withprogrammable conversion times and filtering.

The INA220 is a high or low side current shunt and power monitor with an I2Cinterface. The INA220 monitors both shunt drop and supply voltage.

The INA226 is a current shunt and power monitor with an I2C interface.The INA226 monitors both a shunt voltage drop and bus supply voltage.

INA230 and INA231 are high or low side current shunt and power monitorswith an I2C interface. The chips monitor both a shunt voltage drop andbus supply voltage.

The shunt value in micro-ohms can be set via platform data or device tree atcompile-time or via the shunt_resistor attribute in sysfs at run-time. Pleaserefer to the Documentation/devicetree/bindings/hwmon/ina2xx.txt for bindingsif the device tree is used.

Additionally ina226 supports update_interval attribute as described inDocumentation/hwmon/sysfs-interface.rst. Internally the interval is the sum ofbus and shunt voltage conversion times multiplied by the averaging rate. Wedon’t touch the conversion times and only modify the number of averages. Thelower limit of the update_interval is 2 ms, the upper limit is 2253 ms.The actual programmed interval may vary from the desired value.

General sysfs entries

in0_inputShunt voltage(mV) channel
in1_inputBus voltage(mV) channel
curr1_inputCurrent(mA) measurement channel
power1_inputPower(uW) measurement channel
shunt_resistorShunt resistance(uOhm) channel

Sysfs entries for ina226, ina230 and ina231 only

in0_lcritCritical low shunt voltage
in0_critCritical high shunt voltage
in0_lcrit_alarmShunt voltage critical low alarm
in0_crit_alarmShunt voltage critical high alarm
in1_lcritCritical low bus voltage
in1_critCritical high bus voltage
in1_lcrit_alarmBus voltage critical low alarm
in1_crit_alarmBus voltage critical high alarm
power1_critCritical high power
power1_crit_alarmPower critical high alarm
update_intervaldata conversion time; affects number of samples usedto average results for shunt and bus voltages.

Note

  • Configureshunt_resistor before configurepower1_crit, because powervalue is calculated based onshunt_resistor set.
  • Because of the underlying register implementation, only one*crit settingand itsalarm can be active. Writing to one*crit setting clears other*crit settings and alarms. Writing 0 to any*crit setting clears all*crit settings and alarms.