]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iio: adc: ad7173: support changing filter type
authorDavid Lechner <dlechner@baylibre.com>
Fri, 12 Sep 2025 19:09:32 +0000 (14:09 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 13 Sep 2025 14:16:07 +0000 (15:16 +0100)
commitff06b39be1a1f5c97a6095e03a519967966819fe
tree74334931bab7cc9eb97a9d010357ae9d658691c8
parent27901cbc5bbcd4dbe0514999e08304074988a5d7
iio: adc: ad7173: support changing filter type

Add support for changing the filter type to the ad7173 driver.

This family of chips by default uses a sinc5+sinc1 filter. There are
also optional post-filters that can be added in this configuration for
various 50/60Hz rejection purposes. The sinc3 filter doesn't have any
post-filters and handles the output data rate (ODR) a bit differently.
Here, we've opted to use SINC3_MAPx to get the maximum possible
sampling frequencies with the SINC3 filter.

Adding support consists of adding the filter_type and
filter_type_available attributes, making the sampling_frequency
attribute aware of the filter type, and programming the filter
parameters when we configure the channel of the ADC for reading
a sample.

Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7173.c