Re: [PATCH 5/5] iio: adc: ad7606: add gain calibration support

From: Angelo Dureghello
Date: Thu May 01 2025 - 09:51:12 EST


On 30.04.2025 01:34, Andy Shevchenko wrote:
> On Tue, Apr 29, 2025 at 4:08 PM Angelo Dureghello
> <adureghello@xxxxxxxxxxxx> wrote:
> >
> > From: Angelo Dureghello <adureghello@xxxxxxxxxxxx>
> >
> > Add gain calibration support, using resistor values set on devicetree,
> > values to be set accordingly with ADC external RFilter, as explained in
> > the ad7606c-16 datasheet, rev0, page 37.
> >
> > Usage example in the fdt yaml documentation.
>
> ...
>
> > +#define AD7606_CALIB_GAIN_MIN 0
> > +#define AD7606_CALIB_GAIN_STEP 1024
> > +#define AD7606_CALIB_GAIN_MAX 65536
>
Hi Andy,

> Are those values in decimal in the datasheet?
> It looks to me something like
>
> _MAX = (64 * _STEP)
>
> but is it for real? Usually values are limited by the amount of bits
> in the HW, here it spans over 65 steps, i.e. 7 bits would be needed...
> Confusing.
>

true, thanks,
there must be a typo in the datasheet that says 0 to 65536 with a
step of 1024 with 6 bits. Only 0 to 63 are possbile here.

step 0 = 0
step 63 = 64512

Will fix that.

Regards,
angelo

> --
> With Best Regards,
> Andy Shevchenko