All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] hwmon: ina238: add samples and update_interval_us support
@ 2026-06-09 19:43 ` Ferdinand Schwenk
  0 siblings, 0 replies; 14+ messages in thread
From: Ferdinand Schwenk via B4 Relay @ 2026-06-09 19:43 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

v3:
- add missing Signed-off-by trailer to all patches
- address truncation concern by tightening update_interval input clamping in patch 1/3
- preserve equivalent clamping in patch 3/3 after introducing update_interval_us
- Link to v2: https://lore.kernel.org/r/20260608-hwmon-ina238-update-interval-us-v2-v2-0-2d939fbb2ea1@advastore.com

---
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                      | 162 +++++++++++++++++++++++++++-
 include/linux/hwmon.h                       |   2 +
 6 files changed, 185 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] 14+ messages in thread

end of thread, other threads:[~2026-06-09 20:49 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-09 19:43 [PATCH v3 0/3] hwmon: ina238: add samples and update_interval_us support Ferdinand Schwenk via B4 Relay
2026-06-09 19:43 ` Ferdinand Schwenk
2026-06-09 19:43 ` [PATCH v3 1/3] hwmon: ina238: add support for samples and update_interval Ferdinand Schwenk via B4 Relay
2026-06-09 19:43   ` Ferdinand Schwenk
2026-06-09 19:50   ` sashiko-bot
2026-06-09 20:44   ` Guenter Roeck
2026-06-09 19:43 ` [PATCH v3 2/3] hwmon: Add update_interval_us chip attribute Ferdinand Schwenk via B4 Relay
2026-06-09 19:43   ` Ferdinand Schwenk
2026-06-09 19:48   ` sashiko-bot
2026-06-09 20:45   ` Guenter Roeck
2026-06-09 19:43 ` [PATCH v3 3/3] hwmon: ina238: add update_interval_us attribute Ferdinand Schwenk via B4 Relay
2026-06-09 19:43   ` Ferdinand Schwenk
2026-06-09 19:49   ` sashiko-bot
2026-06-09 20:49   ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.