Re: [PATCH 2/2] hwmon: (ina2xx) Shift INA234 shunt and current registers
From: Guenter Roeck
Date: Tue Mar 03 2026 - 12:03:53 EST
On Tue, Mar 03, 2026 at 12:07:02PM +0100, Jonas Rebmann wrote:
> 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@xxxxxxxxxxxxxx>
Applied.
Thanks,
Guenter