[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aCtmt+ozqSRDGQxi@JSANTO12-L01.ad.analog.com>
Date: Mon, 19 May 2025 14:13:27 -0300
From: Jonathan Santos <jonath4nns@...il.com>
To: Jonathan Santos <Jonathan.Santos@...log.com>
Cc: linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
andy@...nel.org, nuno.sa@...log.com, Michael.Hennerich@...log.com,
marcelo.schmitt@...log.com, jic23@...nel.org, robh@...nel.org,
krzk+dt@...nel.org, conor+dt@...nel.org, marcelo.schmitt1@...il.com,
linus.walleij@...aro.org, brgl@...ev.pl, lgirdwood@...il.com,
broonie@...nel.org, dlechner@...libre.com,
Pop Paul <paul.pop@...log.com>
Subject: Re: [PATCH v8 10/11] iio: adc: ad7768-1: add filter type and
oversampling ratio attributes
On 05/15, Jonathan Santos wrote:
> Separate filter type and decimation rate from the sampling frequency
> attribute. The new filter type attribute enables sinc3, sinc3+rej60
> and wideband filters, which were previously unavailable.
>
> Previously, combining decimation and MCLK divider in the sampling
> frequency obscured performance trade-offs. Lower MCLK divider
> settings increase power usage, while lower decimation rates reduce
> precision by decreasing averaging. By creating an oversampling
> attribute, which controls the decimation, users gain finer control
> over performance.
>
> The addition of those attributes allows a wider range of sampling
> frequencies and more access to the device features. Sampling frequency
> table is updated after every digital filter parameter change.
>
> Changes in the sampling frequency are not allowed anymore while in
> buffered mode.
>
> Reviewed-by: David Lechner <dlechner@...libre.com>
> Co-developed-by: Pop Paul <paul.pop@...log.com>
> Signed-off-by: Pop Paul <paul.pop@...log.com>
> Signed-off-by: Jonathan Santos <Jonathan.Santos@...log.com>
...
> +
> +/* Decimation Rate range for each filter type */
> +static const int ad7768_dec_rate_range[][3] = {
> + [AD7768_FILTER_SINC5] = { 8, 8, 1024 },
> + [AD7768_FILTER_SINC3] = { 32, 32, 163840 },
> + [AD7768_FILTER_WIDEBAND] = { 32, 32, 1024 },
> + [AD7768_FILTER_SINC3_REJ60] = { 32, 32, 163840 },
> +};
> +
Since we're still discussing some points — is the `step` in
`[min step max]` for the IIO range additive or multiplicative? It is not
clear on documentation, maybe on purpose or I have missed something.
Here, decimation/OSR doubles from 8 or 32 for SINC5/WIDEBAND, and is a
multiple of 32 for SINC3. So I'm still unsure how to represent this to be
clear to the user.
> +/*
> + * The AD7768-1 supports three primary filter types:
> + * Sinc5, Sinc3, and Wideband.
> + * However, the filter register values can also encode additional parameters
> + * such as decimation rates and 60Hz rejection. This utility array separates
> + * the filter type from these parameters.
> + */
...
> --
> 2.34.1
>
Powered by blists - more mailing lists