Re: [PATCH v11 10/11] iio: adc: ad7768-1: add filter type and oversampling ratio attributes

From: Andy Shevchenko
Date: Fri Jun 13 2025 - 08:45:24 EST


On Wed, Jun 11, 2025 at 08:51:50AM -0300, 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.

...

> + /*
> + * The SINC3_DEC_RATE value is a 13-bit value split across two
> + * registers: MSB [12:8] and LSB [7:0]. Prepare the 13-bit value using
> + * FIELD_PREP and store it with the right endianness in dec_rate_reg.

FIELD_PREP()

> + */

--
With Best Regards,
Andy Shevchenko