[PATCH v2 0/3] hwmon: ina238: add samples and update_interval_us support

From: Ferdinand Schwenk via B4 Relay

Date: Mon Jun 08 2026 - 09:04:45 EST


The INA238 family exposes ADC averaging and conversion timing controls
through ADC_CONFIG. Add support for the samples and update_interval
chip attributes and introduce a generic update_interval_us companion
attribute for devices that need sub-millisecond resolution.

The shortest INA238 conversion time steps are below 1 ms, so several
valid hardware settings collapse to the same update_interval value when
reported only in milliseconds. Keep update_interval in milliseconds as
required by the existing hwmon ABI and provide update_interval_us to
report and program the same total conversion cycle time with microsecond
resolution.

Patch 1 adds samples and update_interval support for the INA238 family.
Patch 2 adds the generic hwmon update_interval_us attribute and
documents it.
Patch 3 wires the new attribute up in the INA238 driver.

Link: https://lore.kernel.org/all/20260522-hwmon-ina238-add-samples-update-interval-v1-0-e1acfceb447e@xxxxxxxxxxxxx/
---
v2:
- keep update_interval in milliseconds to preserve the existing ABI
- add the generic update_interval_us hwmon chip attribute and documentation
- implement update_interval_us for ina238
- report and program intervals using the active averaging count

---
Ferdinand Schwenk (3):
hwmon: ina238: add support for samples and update_interval
hwmon: Add update_interval_us chip attribute
hwmon: ina238: add update_interval_us attribute

Documentation/ABI/testing/sysfs-class-hwmon | 14 +++
Documentation/hwmon/ina238.rst | 4 +
Documentation/hwmon/sysfs-interface.rst | 4 +
drivers/hwmon/hwmon.c | 1 +
drivers/hwmon/ina238.c | 160 +++++++++++++++++++++++++++-
include/linux/hwmon.h | 2 +
6 files changed, 183 insertions(+), 2 deletions(-)
---
base-commit: 028ef9c96e96197026887c0f092424679298aae8
change-id: 20260608-hwmon-ina238-update-interval-us-v2-13448de0a083

Best regards,
--
Ferdinand Schwenk <ferdinand.schwenk@xxxxxxxxxxxxx>