diff options
| author | Ferdinand Schwenk <ferdinand.schwenk@advastore.com> | 2026-06-09 21:43:10 +0200 |
|---|---|---|
| committer | Guenter Roeck <linux@roeck-us.net> | 2026-06-09 13:48:13 -0700 |
| commit | 1f7a5cfe44bf96bf54ce879339c896598db8e12e (patch) | |
| tree | 5ea8f0491e5be644246101116cf81b3c06dd93ec /scripts/Makefile.thinlto | |
| parent | 55c01d37949d215281106a3e532dd56fe678493d (diff) | |
hwmon: (ina238) Add support for samples and update_interval
Expose INA238 ADC averaging count (AVG) and conversion timing
(VBUSCT/VSHCT/VTCT) through chip-level hwmon attributes:
chip/samples
chip/update_interval
Use per-chip conversion-time lookup tables so the same helpers work
for INA228/INA237/INA238/INA700/INA780 and SQ52206. Cache ADC_CONFIG
in driver data and update it on writes to avoid extra register reads
during read-modify-write updates.
Report update_interval in milliseconds as required by the hwmon ABI.
Compute it from raw ADC cycle time multiplied by the active averaging
count, and apply the inverse mapping on writes so programmed conversion
time tracks the selected sample count.
Clamp user-provided update_interval before unit scaling to prevent
overflow in arithmetic conversions.
Also combine chip attributes in HWMON_CHANNEL_INFO using a bitwise OR
for a single logical chip channel.
Signed-off-by: Ferdinand Schwenk <ferdinand.schwenk@advastore.com>
Link: https://lore.kernel.org/r/20260609-hwmon-ina238-update-interval-us-v2-v3-1-016b55567950@advastore.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
