Re: [PATCH 0/2] hwmon: ina238: Add samples and update_interval support

From: Guenter Roeck

Date: Fri May 22 2026 - 09:26:15 EST


On 5/22/26 00:03, Ferdinand Schwenk via B4 Relay wrote:
This series exposes the INA238 ADC_CONFIG register's averaging count
(AVG) and conversion time fields (VBUSCT, VSHCT, VTCT) through the
standard hwmon chip-level attributes chip/samples and
chip/update_interval.

The first patch adds read/write support for both attributes using a
per-chip conversion-time lookup table to correctly handle all
supported variants: INA228, INA237, INA238, INA700, INA780 (sharing
ina238_conv_time[]) and the Silergy SQ52206 (sq52206_conv_time[]).

The second patch uses microseconds as the unit for update_interval
instead of milliseconds. The INA238 supports conversion times as
short as 50 us; millisecond precision would make the four shortest
steps (50, 84, 150, 280 us) indistinguishable and inaccessible.
Since chip/update_interval is introduced in this same series, no
existing ABI is broken.


Are you serious ? The hwmon ABI says clearly that the unit is milliseconds.

What: /sys/class/hwmon/hwmonX/update_interval
Description:
The interval at which the chip will update readings.
Unit: millisecond

It doesn't matter if attribute support is introduced with the series
or not. It is still an ABI violation.

Guenter