# Kernel driver ina2xx

_Peios Kernel / Hardware and drivers / Hardware monitoring_

> Supported chips:

<a id="rst-kernel-driver-ina2xx"></a>

Supported chips:

> - Texas Instruments INA219
>
>   Prefix: 'ina219' Addresses: I2C 0x40 - 0x4f
>
>   Datasheet: Publicly available at the Texas Instruments website
>
>   > [https://www.ti.com/](<https://www.ti.com/>)
>
> - Texas Instruments INA220
>
>   Prefix: 'ina220'
>
>   Addresses: I2C 0x40 - 0x4f
>
>   Datasheet: Publicly available at the Texas Instruments website
>
>   > [https://www.ti.com/](<https://www.ti.com/>)
>
> - Texas Instruments INA226
>
>   Prefix: 'ina226'
>
>   Addresses: I2C 0x40 - 0x4f
>
>   Datasheet: Publicly available at the Texas Instruments website
>
>   > [https://www.ti.com/](<https://www.ti.com/>)
>
> - Texas Instruments INA230
>
>   Prefix: 'ina230'
>
>   Addresses: I2C 0x40 - 0x4f
>
>   Datasheet: Publicly available at the Texas Instruments website
>
>   > [https://www.ti.com/](<https://www.ti.com/>)
>
> - Texas Instruments INA231
>
>   Prefix: 'ina231'
>
>   Addresses: I2C 0x40 - 0x4f
>
>   Datasheet: Publicly available at the Texas Instruments website
>
>   > [https://www.ti.com/](<https://www.ti.com/>)
>
> - Texas Instruments INA260
>
>   Prefix: 'ina260'
>
>   Addresses: I2C 0x40 - 0x4f
>
>   Datasheet: Publicly available at the Texas Instruments website
>
>   > [https://www.ti.com/](<https://www.ti.com/>)
>
> - Silergy SY24655
>
>   Prefix: 'sy24655'
>
>   Addresses: I2C 0x40 - 0x4f
>
>   Datasheet: Publicly available at the Silergy website
>
>   > [https://us1.silergy.com/](<https://us1.silergy.com/>)

Author: Lothar Felten &lt;[lothar.felten@gmail.com](<mailto:lothar.felten@gmail.com>)&gt;

<a id="rst-description"></a>

## Description

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

The INA220 is a high or low side current shunt and power monitor with an I2C interface. 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 monitors with an I2C interface. The chips monitor both a shunt voltage drop and bus supply voltage.

INA260 is a high or low side current and power monitor with integrated shunt resistor.

The SY24655 is a high- and low-side current shunt and power monitor with an I2C interface. The SY24655 supports both shunt drop and supply voltage, with programmable calibration value and conversion times. The SY24655 can also calculate average power for use in energy conversion.

The shunt value in micro-ohms can be set via platform data or device tree at compile-time or via the shunt_resistor attribute in sysfs at run-time. Please refer to the Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml for bindings if the device tree is used.

Additionally ina226 supports update_interval attribute as described in [Documentation/hwmon/sysfs-interface.rst](/kernel/hardware/hwmon/sysfs-interface.md). Internally the interval is the sum of bus and shunt voltage conversion times multiplied by the averaging rate. We don't touch the conversion times and only modify the number of averages. The lower limit of the update_interval is 2 ms, the upper limit is 2253 ms. The actual programmed interval may vary from the desired value.

<a id="rst-general-sysfs-entries"></a>

## General sysfs entries


<table>
<tbody>
<tr>
<td>


in0_input

</td>
<td>


Shunt voltage(mV) channel

</td>
</tr>
<tr>
<td>


in1_input

</td>
<td>


Bus voltage(mV) channel

</td>
</tr>
<tr>
<td>


curr1_input

</td>
<td>


Current(mA) measurement channel

</td>
</tr>
<tr>
<td>


power1_input

</td>
<td>


Power(uW) measurement channel

</td>
</tr>
<tr>
<td>


shunt_resistor

</td>
<td>


Shunt resistance(uOhm) channel (not for ina260)

</td>
</tr>
</tbody>
</table>

<a id="rst-additional-sysfs-entries-for-ina226-ina230-ina231-ina260-and-sy24655"></a>

## Additional sysfs entries for ina226, ina230, ina231, ina260, and sy24655


<table>
<tbody>
<tr>
<td>


curr1_lcrit

</td>
<td>


Critical low current

</td>
</tr>
<tr>
<td>


curr1_crit

</td>
<td>


Critical high current

</td>
</tr>
<tr>
<td>


curr1_lcrit_alarm

</td>
<td>


Current critical low alarm

</td>
</tr>
<tr>
<td>


curr1_crit_alarm

</td>
<td>


Current critical high alarm

</td>
</tr>
<tr>
<td>


in0_lcrit

</td>
<td>


Critical low shunt voltage

</td>
</tr>
<tr>
<td>


in0_crit

</td>
<td>


Critical high shunt voltage

</td>
</tr>
<tr>
<td>


in0_lcrit_alarm

</td>
<td>


Shunt voltage critical low alarm

</td>
</tr>
<tr>
<td>


in0_crit_alarm

</td>
<td>


Shunt voltage critical high alarm

</td>
</tr>
<tr>
<td>


in1_lcrit

</td>
<td>


Critical low bus voltage

</td>
</tr>
<tr>
<td>


in1_crit

</td>
<td>


Critical high bus voltage

</td>
</tr>
<tr>
<td>


in1_lcrit_alarm

</td>
<td>


Bus voltage critical low alarm

</td>
</tr>
<tr>
<td>


in1_crit_alarm

</td>
<td>


Bus voltage critical high alarm

</td>
</tr>
<tr>
<td>


power1_crit

</td>
<td>


Critical high power

</td>
</tr>
<tr>
<td>


power1_crit_alarm

</td>
<td>


Power critical high alarm

</td>
</tr>
<tr>
<td>


update_interval

</td>
<td>


data conversion time; affects number of samples used to average results for shunt and bus voltages.

</td>
</tr>
</tbody>
</table>

<a id="rst-sysfs-entries-for-sy24655-only"></a>

## Sysfs entries for sy24655 only


<table>
<tbody>
<tr>
<td>


power1_average

</td>
<td>


average power from last reading to the present.

</td>
</tr>
</tbody>
</table>

> [!NOTE]
>
> - Configure `shunt_resistor` before configure `power1_crit`, because power value is calculated based on `shunt_resistor` set.
>
> - Because of the underlying register implementation, only one `*crit` setting and its `alarm` 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.
