Re: [PATCH] hwmon: ina238: Add support for shunt voltage scaling

From: Guenter Roeck
Date: Mon Jan 20 2025 - 11:38:41 EST


On 1/20/25 08:23, Potin Lai wrote:
The INA238 sensor reports shunt voltage with microvolt precision.
However, the hwmon driver currently exposes this value only in
millivolts via `in0_input`, which results in a loss of precision for
readings within the range of ±1 mV.

This patch introduces an `in0_scale` attribute to provide the scaling
factor applied to the shunt voltage reading. By exposing this attribute,
users can accurately interpret the in0_input values in microvolts,
preserving the sensor's full precision.

Signed-off-by: Potin Lai <potin.lai.pt@xxxxxxxxx>

Sorry, this is an ABI violation and thus a no-go. in0_input is and will
always be reported in mV.

Guenter