]> git.ipfire.org Git - thirdparty/linux.git/commit
hwmon: (ina238) Add update_interval_us attribute
authorFerdinand Schwenk <ferdinand.schwenk@advastore.com>
Tue, 9 Jun 2026 19:43:12 +0000 (21:43 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 9 Jun 2026 20:48:19 +0000 (13:48 -0700)
commitb47f4a72c62f2db5995ee4c7adfcd876faadf328
treea622da7facc15d1d57ea94045e41d4bee98b624f
parent82508141450d90a6d92a14e93e5a00ffb193f5e0
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>
Documentation/hwmon/ina238.rst
drivers/hwmon/ina238.c