From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02FDC126C03; Fri, 10 Jul 2026 00:36:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783643807; cv=none; b=R6wxVdRr2aqjt/FCjHtCRuIW77220AyqMFg+JAp1rBQ6kO4ZyVOmRlAMiqlWNhyRgWyckaPQaaMVDbLUcKWNAzaAbd16i95xWglLXmucXvvXqMlYP1uxkC9GU4Zjt3B2HJrf382UhO8FG0QMNlXIutMlLLVcD0x8PL5hvIT7hZE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783643807; c=relaxed/simple; bh=y0ReA3FUmiRYjz1pM8SySQ19jkjKvSIiDSeaJpMX2zg=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SKJaurV3q9zYj9VBLE/fu/JfqDaeRFPegI3hZqCPgj1EeSjw7/W5M6BCcUUX3CdVRm5fzUsowL9ErdKWWE0o+3eXbmrpbCT405oPohs+iuY5bsZGONYHLBqCsoV6K+2TnLmHDov5QrUc9hMD4UMf+DXlBylLot03vQMZW9LjBNA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=g5S9GZzg; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="g5S9GZzg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D837C1F000E9; Fri, 10 Jul 2026 00:36:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783643805; bh=LkU8EBkA44L7LZPGszAlWuIZvDx7GkqaiXRmR+MfVQw=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=g5S9GZzg6lL3904SZer0QuLix8Cl7ZWatBbjoFlI1o2ZZNAfk5oHIeS1FY6cORUET pkMyUs/YVRjNTr1NO2LeggFMK1u+jEybBiGXibDEb6AdYi877/Jrdr2CusRvQWf4Wj 2NpnC00NmGg+zgJObd/35eC6TtLBNnpJ8r1i97oZAap2ZcljOXFtCsq413Zmb5n1XE k5sCs8sYgYPySI9rZ9LnWlxj/IShDeycN0PQOnijLqb5o6wEcKHgGtrHPg8p205bNi XK3lArujHjExBqY4/dQZL96V8ctim0k3Do2XgDWzutjogV6sYtRigD2eYfSUYVf5L2 KA1pOSbwfOXXg== Date: Fri, 10 Jul 2026 01:36:38 +0100 From: Jonathan Cameron To: Janani Sunil Cc: Nuno =?UTF-8?B?U8Oh?= , Michael Hennerich , David Lechner , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Olivier Moysan , Philipp Zabel , Linus Walleij , Bartosz Golaszewski , Jonathan Corbet , Shuah Khan , , , , , , , Subject: Re: [PATCH 2/6] iio: backend: Add support for CRC Message-ID: <20260710013638.79e094a6@jic23-huawei> In-Reply-To: <20260709-ad7768-driver-v1-2-44e1194fd96a@analog.com> References: <20260709-ad7768-driver-v1-0-44e1194fd96a@analog.com> <20260709-ad7768-driver-v1-2-44e1194fd96a@analog.com> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 9 Jul 2026 10:50:13 +0200 Janani Sunil 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 > --- > 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. > + */