mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] hwmon: ina238: Add samples and update_interval support
@ 2026-05-22  7:03 Ferdinand Schwenk via B4 Relay
  2026-05-22  7:03 ` [PATCH 1/2] hwmon: ina238: add support for samples and update_interval Ferdinand Schwenk via B4 Relay
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ferdinand Schwenk via B4 Relay @ 2026-05-22  7:03 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: linux-hwmon, linux-kernel, Ferdinand Schwenk, richard.leitner

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.

Signed-off-by: Ferdinand Schwenk <ferdinand.schwenk@advastore.com>
---
Ferdinand Schwenk (2):
      hwmon: ina238: add support for samples and update_interval
      hwmon: ina238: use microseconds for update_interval

 drivers/hwmon/ina238.c | 134 ++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 132 insertions(+), 2 deletions(-)
---
base-commit: 028ef9c96e96197026887c0f092424679298aae8
change-id: 20260520-hwmon-ina238-add-samples-update-interval-28761658e11f

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



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

end of thread, other threads:[~2026-05-28  4:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-22  7:03 [PATCH 0/2] hwmon: ina238: Add samples and update_interval support Ferdinand Schwenk via B4 Relay
2026-05-22  7:03 ` [PATCH 1/2] hwmon: ina238: add support for samples and update_interval Ferdinand Schwenk via B4 Relay
2026-05-22  7:03 ` [PATCH 2/2] hwmon: ina238: use microseconds for update_interval Ferdinand Schwenk via B4 Relay
2026-05-22 13:18 ` [PATCH 0/2] hwmon: ina238: Add samples and update_interval support Guenter Roeck
2026-05-26  9:08   ` AW: " Ferdinand Schwenk
2026-05-28  4:01     ` Guenter Roeck

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

all inboxes | Powered by JetHome®