Re: [PATCH 01/14] iio: backend: add support for filter config
From: Jonathan Cameron
Date: Sat Feb 22 2025 - 11:49:56 EST
On Thu, 20 Feb 2025 15:54:11 +0200
Antoniu Miclaus <antoniu.miclaus@xxxxxxxxxx> wrote:
> Add backend support for filter enable/disable.
> This setting can be adjusted within the IP cores interfacing devices.
Hi Antoniu,
Please add some details on what this filtering actually is.
There are lots of possibilities. I'm not sure why you'd have
just an enable on the backend rather than a richer set of controls?
Thanks,
Jonathan
>
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@xxxxxxxxxx>
> ---
> drivers/iio/industrialio-backend.c | 26 ++++++++++++++++++++++++++
> include/linux/iio/backend.h | 6 ++++++
> 2 files changed, 32 insertions(+)
>
> diff --git a/drivers/iio/industrialio-backend.c b/drivers/iio/industrialio-backend.c
> index d4ad36f54090..ffafe7c73508 100644
> --- a/drivers/iio/industrialio-backend.c
> +++ b/drivers/iio/industrialio-backend.c
> @@ -778,6 +778,32 @@ static int __devm_iio_backend_get(struct device *dev, struct iio_backend *back)
> return 0;
> }
>
> +/**
> + * iio_backend_filter_enable - Enable filter
> + * @back: Backend device
> + *
> + * RETURNS:
> + * 0 on success, negative error number on failure.
> + */
> +int iio_backend_filter_enable(struct iio_backend *back)
> +{
> + return iio_backend_op_call(back, filter_enable);
> +}
> +EXPORT_SYMBOL_NS_GPL(iio_backend_filter_enable, "IIO_BACKEND");
> +
> +/**
> + * iio_backend_filter_disable - Disable filter
> + * @back: Backend device
> + *
> + * RETURNS:
> + * 0 on success, negative error number on failure.
> + */
> +int iio_backend_filter_disable(struct iio_backend *back)
> +{
> + return iio_backend_op_call(back, filter_disable);
> +}
> +EXPORT_SYMBOL_NS_GPL(iio_backend_filter_disable, "IIO_BACKEND");
> +
> /**
> * iio_backend_ddr_enable - Enable interface DDR (Double Data Rate) mode
> * @back: Backend device
> diff --git a/include/linux/iio/backend.h b/include/linux/iio/backend.h
> index e45b7dfbec35..7987d9f1cdb3 100644
> --- a/include/linux/iio/backend.h
> +++ b/include/linux/iio/backend.h
> @@ -100,6 +100,8 @@ enum iio_backend_interface_type {
> * @read_raw: Read a channel attribute from a backend device
> * @debugfs_print_chan_status: Print channel status into a buffer.
> * @debugfs_reg_access: Read or write register value of backend.
> + * @filter_enable: Enable filter.
> + * @filter_disable: Disable filter.
> * @ddr_enable: Enable interface DDR (Double Data Rate) mode.
> * @ddr_disable: Disable interface DDR (Double Data Rate) mode.
> * @data_stream_enable: Enable data stream.
> @@ -150,6 +152,8 @@ struct iio_backend_ops {
> size_t len);
> int (*debugfs_reg_access)(struct iio_backend *back, unsigned int reg,
> unsigned int writeval, unsigned int *readval);
> + int (*filter_enable)(struct iio_backend *back);
> + int (*filter_disable)(struct iio_backend *back);
> int (*ddr_enable)(struct iio_backend *back);
> int (*ddr_disable)(struct iio_backend *back);
> int (*data_stream_enable)(struct iio_backend *back);
> @@ -190,6 +194,8 @@ int iio_backend_data_sample_trigger(struct iio_backend *back,
> int devm_iio_backend_request_buffer(struct device *dev,
> struct iio_backend *back,
> struct iio_dev *indio_dev);
> +int iio_backend_filter_enable(struct iio_backend *back);
> +int iio_backend_filter_disable(struct iio_backend *back);
> int iio_backend_ddr_enable(struct iio_backend *back);
> int iio_backend_ddr_disable(struct iio_backend *back);
> int iio_backend_data_stream_enable(struct iio_backend *back);