Re: [PATCH v2 15/16] iio: adc: ad7768-1: add filter type and oversampling ratio attributes
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Date: 2025-01-30 16:39:27
Also in:
linux-iio, lkml
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Date: 2025-01-30 16:39:27
Also in:
linux-iio, lkml
On Mon, 27 Jan 2025 12:14:19 -0300 Jonathan Santos [off-list ref] wrote:
Separate filter type and decimation rate from the sampling frequency attribute. The new filter type attribute enables SINC3 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. Co-developed-by: PopPaul2021 <redacted> Signed-off-by: PopPaul2021 <redacted> Signed-off-by: Jonathan Santos <redacted>
On trivial thing I noticed.
@@ -745,6 +1000,12 @@ static int ad7768_setup(struct iio_dev *indio_dev) return ret; } + /* + * Set Default Digital Filter configuration: + * SINC5 filter with x32 Decimation rate + */ + ret = ad7768_configure_dig_fil(indio_dev, SINC5, 32);
Check ret?
+ /* Set the default sampling frequency to 32000 kSPS */ return ad7768_set_freq(st, 32000); }