Re: [PATCH 2/6] iio: backend: Add support for CRC
From: Jonathan Cameron
Date: Thu Jul 09 2026 - 20:36:58 EST
On Thu, 9 Jul 2026 10:50:13 +0200
Janani Sunil <janani.sunil@xxxxxxxxxx> wrote:
> Add a backend operation to enable or disable Cyclic Redundancy Check
> processing for data integrity verification. When enabled, the backend
> will generate, verify, or process CRC information for data samples
> transmitted over the interface, allowing the host to detect corrupted
> samples.
>
> Signed-off-by: Janani Sunil <janani.sunil@xxxxxxxxxx>
> ---
> drivers/iio/industrialio-backend.c | 33 +++++++++++++++++++++++++++++++++
> include/linux/iio/backend.h | 4 ++++
> 2 files changed, 37 insertions(+)
>
> diff --git a/drivers/iio/industrialio-backend.c b/drivers/iio/industrialio-backend.c
> index f7a4be8ec320..379a426931cd 100644
> --- a/drivers/iio/industrialio-backend.c
> +++ b/drivers/iio/industrialio-backend.c
> @@ -886,6 +886,39 @@ int iio_backend_num_lanes_set(struct iio_backend *back, unsigned int num_lanes)
> }
> EXPORT_SYMBOL_NS_GPL(iio_backend_num_lanes_set, "IIO_BACKEND");
>
> +/**
> + * iio_backend_crc_enable - Enable the CRC generation.
> + * @back: Backend device
> + *
> + * Enable Cyclic Redundancy Check processing for data integrity
> + * verification. When enabled, the backend will generate, verify, or process
Verification should be on previous line - under 80 chars.
> + * CRC information for data samples transmitted over the interface.
> + *
> + * RETURNS:
> + * 0 on success, negative error number on failure.
> + */
> +int iio_backend_crc_enable(struct iio_backend *back)
> +{
> + return iio_backend_op_call(back, crc_enable);
> +}
> +EXPORT_SYMBOL_NS_GPL(iio_backend_crc_enable, "IIO_BACKEND");
> +
> +/**
> + * iio_backend_crc_disable - Disable the CRC generation.
> + * @back: Backend device
> + *
> + * Disable Cyclic Redundancy Check processing. When disabled, the backend
> + * will stop generating, verifying, or processing CRC information for data samples.
Odd line wrap. Keep to a consistent <= 80 chars unless there is a reason
to do otherwise.
> + *
> + * RETURNS:
> + * 0 on success, negative error number on failure.
> + */