diff options
| author | Jonas Rebmann <jre@pengutronix.de> | 2026-03-03 12:07:02 +0100 |
|---|---|---|
| committer | Guenter Roeck <linux@roeck-us.net> | 2026-03-30 19:45:05 -0700 |
| commit | eeca1114d1e2cc0eacaebb80f3f2afbaebfc60be (patch) | |
| tree | d300faafb7d4a2972e8785fec1cd7cb02cce368a /tools/lib/python | |
| parent | 932ca40b10e94923dc6447f8e9026838793fd188 (diff) | |
hwmon: (ina2xx) Shift INA234 shunt and current registers
The INA219 has the lowest three bits of the bus voltage register
zero-reserved, the bus_voltage_shift ina2xx_config field was introduced
to accommodate for that.
The INA234 has four bits of the bus voltage, of the shunt voltage, and
of the current registers zero-reserved but the latter two were
implemented by choosing a 16x higher shunt_div instead of a separate
field specifying a bit shift.
This is possible because shunt voltage and current are divided by
shunt_div, hence a 16x higher shunt_div results in a 16x smaller LSB for
both the shunt voltage and the current register, perfectly accounting
for the missing bit shift.
For consistency and correctness, account for the reserved bits via
shunt_voltage_shift and current_shift configuration fields as already
done for voltage registers and use the conversion constants given in the
INA234 datasheet.
Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
Link: https://lore.kernel.org/r/20260303-ina234-shift-v1-2-318c33ac4480@pengutronix.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
