Re: [PATCH v2] iio: adc: ltc2471: Fix LTC2473 differential offset

From: Andy Shevchenko

Date: Mon Nov 09 2026 - 12:33:13 EST


On Mon, Nov 09, 2026 at 01:12:08PM +0100, Joshua Crofts wrote:
> On Mon, 9 Nov 2026 18:06:59 +0800
> raoxu <raoxu@xxxxxxxxxxxxx> wrote:
>
> > The LTC2473 reports its differential conversion result as an unsigned
> > 16-bit value spanning -VREF to +VREF. The IIO scale is consequently
> > reported as 2 * VREF divided by 2^16.
> >
> > IIO offsets are expressed in raw codes, but the driver currently returns
> > -LTC2471_VREF, which is a millivolt value. This makes the processed
> > reading incorrect: with a 1.25 V reference, the midpoint raw code is
> > shifted by 1250 instead of 32768 codes.
> >
> > Return the raw-code offset so that the midpoint maps to 0 mV and the
> > endpoints map to -VREF and +VREF as intended. The single-ended LTC2471
> > does not expose the offset attribute and is unaffected.
> >
> > The supplied fix was reviewed and this commit message prepared with
> > OpenCode AI assistance.
> >
> > Fixes: 1d3eacbfa644 ("iio: Add LTC2471/LTC2473 driver")
> > Signed-off-by: Xu Rao <raoxu@xxxxxxxxxxxxx>
> > Cc: stable@xxxxxxxxxxxxxxx
> > ---
>
> Looks fine, but please wait at least 24 hours before sending a
> new version. If you spot an issue after sending the patch, please
> reply to it describing the problem.

Yep, it misses tag from Nuno now. So, v3 with changelog and all tags please!
Easy to get if you use `b4` for that.

> Reviewed-by: Joshua Crofts <crofts@xxxxxxxxxx>

--
With Best Regards,
Andy Shevchenko