Files
linux/Documentation/hwmon/ina238.rst
Ferdinand Schwenk b47f4a72c6 hwmon: (ina238) Add update_interval_us attribute
The INA238 family supports eight conversion time steps from 50 us to
4120 us (SQ52206: 66 us to 8230 us). At the millisecond granularity of
update_interval, the four shortest steps (50, 84, 150, 280 us) all
round to the same value and cannot be individually selected.

Add support for the generic update_interval_us attribute, which reports
and programs the same ADC cycle time as update_interval but in
microseconds, giving userspace full access to all conversion time steps.

Both attributes reflect the total cycle time including the active
averaging count: the reported value is the raw conversion time
multiplied by the number of averaged samples, and writes apply the
inverse mapping.

Signed-off-by: Ferdinand Schwenk <ferdinand.schwenk@advastore.com>
Link: https://lore.kernel.org/r/20260609-hwmon-ina238-update-interval-us-v2-v3-3-016b55567950@advastore.com
[groeck: Fixed some multi-line alignment issues]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-06-09 13:48:19 -07:00

114 lines
3.0 KiB
ReStructuredText

.. SPDX-License-Identifier: GPL-2.0-only
Kernel driver ina238
====================
Supported chips:
* Texas Instruments INA228
Prefix: 'ina228'
Addresses: I2C 0x40 - 0x4f
Datasheet:
https://www.ti.com/lit/gpn/ina228
* Texas Instruments INA237
Prefix: 'ina237'
Addresses: I2C 0x40 - 0x4f
Datasheet:
https://www.ti.com/lit/gpn/ina237
* Texas Instruments INA238
Prefix: 'ina238'
Addresses: I2C 0x40 - 0x4f
Datasheet:
https://www.ti.com/lit/gpn/ina238
* Texas Instruments INA700
Datasheet:
https://www.ti.com/product/ina700
* Texas Instruments INA780
Datasheet:
https://www.ti.com/product/ina780a
* Silergy SQ52206
Prefix: 'SQ52206'
Addresses: I2C 0x40 - 0x4f
Author: Nathan Rossi <nathan.rossi@digi.com>
Description
-----------
The INA238 is a current shunt, power and temperature monitor with an I2C
interface. It includes a number of programmable functions including alerts,
conversion rate, sample averaging and selectable shunt voltage accuracy.
The shunt value in micro-ohms can be set via device properties, either from
platform code or from device tree data. Please refer to
Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml for bindings if
device tree is used.
INA237 is a functionally equivalent variant of INA238 with slightly
different accuracy. INA228 is another variant of INA238 with higher ADC
resolution. This chip also reports the energy.
INA700 and INA780 are variants of the chip series with built-in shunt resistor.
They also report the energy.
SQ52206 is a mostly compatible chip from Sylergy. It reports the energy
as well as the peak power consumption.
Sysfs entries
-------------
======================= =======================================================
in0_input Shunt voltage (mV)
in0_min Minimum shunt voltage threshold (mV)
in0_min_alarm Minimum shunt voltage alarm
in0_max Maximum shunt voltage threshold (mV)
in0_max_alarm Maximum shunt voltage alarm
in1_input Bus voltage (mV)
in1_min Minimum bus voltage threshold (mV)
in1_min_alarm Minimum shunt voltage alarm
in1_max Maximum bus voltage threshold (mV)
in1_max_alarm Maximum shunt voltage alarm
power1_input Power measurement (uW)
power1_max Maximum power threshold (uW)
power1_max_alarm Maximum power alarm
power1_input_highest Peak Power (uW)
(SQ52206 only)
curr1_input Current measurement (mA)
curr1_min Minimum current threshold (mA)
curr1_min_alarm Minimum current alarm
curr1_max Maximum current threshold (mA)
curr1_max_alarm Maximum current alarm
energy1_input Energy measurement (uJ)
(SQ52206, INA237, and INA780 only)
temp1_input Die temperature measurement (mC)
temp1_max Maximum die temperature threshold (mC)
temp1_max_alarm Maximum die temperature alarm
samples ADC averaging count (1, 4, 16, 64, 128, 256, 512, 1024)
update_interval Total ADC conversion cycle time including averaging (ms)
update_interval_us Total ADC conversion cycle time including averaging (us)
======================= =======================================================