Linux Hardware Monitor development
 help / color / mirror / Atom feed
* [PATCH v2 0/3] hwmon: ina238: add samples and update_interval_us support
@ 2026-06-08 13:03 Ferdinand Schwenk via B4 Relay
  2026-06-08 13:03 ` [PATCH v2 1/3] hwmon: ina238: add support for samples and update_interval Ferdinand Schwenk via B4 Relay
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Ferdinand Schwenk via B4 Relay @ 2026-06-08 13:03 UTC (permalink / raw)
  To: Guenter Roeck, Jonathan Corbet, Shuah Khan
  Cc: linux-hwmon, linux-kernel, linux-doc, richard.leitner,
	ferdinand.schwenk

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@advastore.com/
---
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@advastore.com>



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-06-08 16:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-08 13:03 [PATCH v2 0/3] hwmon: ina238: add samples and update_interval_us support Ferdinand Schwenk via B4 Relay
2026-06-08 13:03 ` [PATCH v2 1/3] hwmon: ina238: add support for samples and update_interval Ferdinand Schwenk via B4 Relay
2026-06-08 13:12   ` sashiko-bot
2026-06-08 16:31     ` Guenter Roeck
2026-06-08 13:03 ` [PATCH v2 2/3] hwmon: Add update_interval_us chip attribute Ferdinand Schwenk via B4 Relay
2026-06-08 13:10   ` sashiko-bot
2026-06-08 16:34   ` Guenter Roeck
2026-06-08 13:03 ` [PATCH v2 3/3] hwmon: ina238: add update_interval_us attribute Ferdinand Schwenk via B4 Relay
2026-06-08 13:13   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox