Re: [PATCH v3] iio: adc: ina2xx: add INA236 support

Rob Herring
2026-04-08T15:55:22Z

On Mon, Mar 16, 2026 at 02:23:04AM +0800, Chuang Zhu wrote:
> The calibration divisor is not directly specified in the datasheet, but can be calculated:
>
> I = Current_LSB * Current
> Current = ShuntVoltage * CAL / calibration_divisor
> CAL = 0.00512 / (Current_LSB * Rshunt)
> ShuntVoltage = Vshunt / ShuntVoltage_LSB
>
> => I = (0.00512 / (calibration_divisor*ShuntVoltage_LSB)) * (Vshunt / Rshunt)
>
> Ohm's law, I = Vshunt / Rshunt
> => 0.00512 / (calibration_divisor*ShuntVoltage_LSB) = 1
>
> ShuntVoltage_LSB = 2.5 uV = 0.0000025 V
> => calibration_divisor = 2048
>
> Signed-off-by: Chuang Zhu <git@chuang.cz>

> @@ -1082,6 +1117,10 @@ static const struct of_device_id ina2xx_of_match[] = {
> .compatible = "ti,ina231",
> .data = (void *)ina226
> },
> + {
> + .compatible = "ti,ina236",

This is not documented. Please add/extend a binding for it.

Rob