Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: backend: add support for filter config

Add backend support for digital filter type selection.

This setting can be adjusted within the IP cores interfacing devices.

The IP core can be configured based on the state of the actual
digital filter configuration of the part.

Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Link: https://patch.msgid.link/20250516082630.8236-2-antoniu.miclaus@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Antoniu Miclaus and committed by
Jonathan Cameron
dc384418 af82280e

+31
+18
drivers/iio/industrialio-backend.c
··· 809 809 } 810 810 811 811 /** 812 + * iio_backend_filter_type_set - Set filter type 813 + * @back: Backend device 814 + * @type: Filter type. 815 + * 816 + * RETURNS: 817 + * 0 on success, negative error number on failure. 818 + */ 819 + int iio_backend_filter_type_set(struct iio_backend *back, 820 + enum iio_backend_filter_type type) 821 + { 822 + if (type >= IIO_BACKEND_FILTER_TYPE_MAX) 823 + return -EINVAL; 824 + 825 + return iio_backend_op_call(back, filter_type_set, type); 826 + } 827 + EXPORT_SYMBOL_NS_GPL(iio_backend_filter_type_set, "IIO_BACKEND"); 828 + 829 + /** 812 830 * iio_backend_ddr_enable - Enable interface DDR (Double Data Rate) mode 813 831 * @back: Backend device 814 832 *
+13
include/linux/iio/backend.h
··· 76 76 IIO_BACKEND_INTERFACE_MAX 77 77 }; 78 78 79 + enum iio_backend_filter_type { 80 + IIO_BACKEND_FILTER_TYPE_DISABLED, 81 + IIO_BACKEND_FILTER_TYPE_SINC1, 82 + IIO_BACKEND_FILTER_TYPE_SINC5, 83 + IIO_BACKEND_FILTER_TYPE_SINC5_PLUS_COMP, 84 + IIO_BACKEND_FILTER_TYPE_MAX 85 + }; 86 + 79 87 /** 80 88 * struct iio_backend_ops - operations structure for an iio_backend 81 89 * @enable: Enable backend. ··· 109 101 * @read_raw: Read a channel attribute from a backend device 110 102 * @debugfs_print_chan_status: Print channel status into a buffer. 111 103 * @debugfs_reg_access: Read or write register value of backend. 104 + * @filter_type_set: Set filter type. 112 105 * @ddr_enable: Enable interface DDR (Double Data Rate) mode. 113 106 * @ddr_disable: Disable interface DDR (Double Data Rate) mode. 114 107 * @data_stream_enable: Enable data stream. ··· 162 153 size_t len); 163 154 int (*debugfs_reg_access)(struct iio_backend *back, unsigned int reg, 164 155 unsigned int writeval, unsigned int *readval); 156 + int (*filter_type_set)(struct iio_backend *back, 157 + enum iio_backend_filter_type type); 165 158 int (*ddr_enable)(struct iio_backend *back); 166 159 int (*ddr_disable)(struct iio_backend *back); 167 160 int (*data_stream_enable)(struct iio_backend *back); ··· 206 195 int devm_iio_backend_request_buffer(struct device *dev, 207 196 struct iio_backend *back, 208 197 struct iio_dev *indio_dev); 198 + int iio_backend_filter_type_set(struct iio_backend *back, 199 + enum iio_backend_filter_type type); 209 200 int iio_backend_ddr_enable(struct iio_backend *back); 210 201 int iio_backend_ddr_disable(struct iio_backend *back); 211 202 int iio_backend_data_stream_enable(struct iio_backend *back);