lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aYnzd55yYK5xRSpr@debian-BULLSEYE-live-builder-AMD64>
Date: Mon, 9 Feb 2026 11:47:19 -0300
From: Marcelo Schmitt <marcelo.schmitt1@...il.com>
To: Andy Shevchenko <andriy.shevchenko@...el.com>
Cc: Marcelo Schmitt <marcelo.schmitt@...log.com>, linux-iio@...r.kernel.org,
	devicetree@...r.kernel.org, linux-doc@...r.kernel.org,
	linux-kernel@...r.kernel.org, jic23@...nel.org,
	michael.hennerich@...log.com, nuno.sa@...log.com,
	eblanc@...libre.com, dlechner@...libre.com, andy@...nel.org,
	robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org,
	corbet@....net
Subject: Re: [PATCH v8 7/8] iio: adc: ad4030: Add support for ADAQ4216 and
 ADAQ4224

On 02/08, Andy Shevchenko wrote:
> On Fri, Feb 06, 2026 at 04:02:19PM -0300, Marcelo Schmitt wrote:
> > ADAQ4216 and ADAQ4224 are similar to AD4030, but feature a PGA circuitry
> > that scales the analog input signal prior to it reaching the ADC. The PGA
> > is controlled through a pair of pins (A0 and A1) whose state define the
> > gain that is applied to the input signal.
> > 
> > Add support for ADAQ4216 and ADAQ4224. Provide a list of PGA options
> > through the IIO device channel scale available interface and enable control
> > of the PGA through the channel scale interface.
> 
> ...
> 
> > +/*
> > + * Gains computed as fractions of 1000 so they can be expressed by integers.
> > + */
> > +static const int adaq4216_hw_gains_vpv[] = {
> > +	1 * MILLI / 3,		/* 333 */
> > +	5 * MILLI / 9,		/* 555 */
> > +	20 * MILLI / 9,		/* 2222 */
> > +	20 * MILLI / 3,		/* 6666 */
> 
> In case you would need a new version, or Jonathan is okay to tweak, I think
> it's better to use float in the comments. The above comment explains the
> MILL multiplier for the values.
> 
> 	1 * MILLI / 3,		/* 0.333 */
> 	5 * MILLI / 9,		/* 0.555 */
> 	20 * MILLI / 9,		/* 0.2222 */
> 	20 * MILLI / 3,		/* 0.6666 */
> 
> > +};
> 
> Btw, if this true (if I am not mistaken in the gain values), the question is
> why 0.2222 is much higher than 0.555.

I guess it has to do with how the PGA is set up, but I don't really know.
Those fractions are specified in the data sheet [1] and test results have shown
those are correct. I can't explain why we have those specific gain values, though.

[1]: https://www.analog.com/media/en/technical-documentation/data-sheets/adaq4216.pdf#unique_2_Connect_42_T1
> 
> -- 
> With Best Regards,
> Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ