Re: [PATCH 3/6] iio: adc: adi-axi-adc: Add support for CRC
From: David Lechner
Date: Thu Jul 09 2026 - 12:03:08 EST
On 7/9/26 3:50 AM, Janani Sunil wrote:
> Add support for enabling and disabling Cyclic Redundancy Check (CRC)
> processing in the AXI ADC backend. CRC provides data integrity verification
> for high-speed ADC data streams, ensuring reliable data transfer between
> the ADC frontend and backend processing systems.
>
> Signed-off-by: Janani Sunil <janani.sunil@xxxxxxxxxx>
> ---
> drivers/iio/adc/adi-axi-adc.c | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/drivers/iio/adc/adi-axi-adc.c b/drivers/iio/adc/adi-axi-adc.c
> index 26b9c75bd4d8..8af42d26aac0 100644
> --- a/drivers/iio/adc/adi-axi-adc.c
> +++ b/drivers/iio/adc/adi-axi-adc.c
> @@ -47,6 +47,8 @@
> #define ADI_AXI_ADC_CTRL_DDR_EDGESEL_MASK BIT(1)
>
> #define ADI_AXI_ADC_REG_CNTRL_3 0x004c
> +#define ADI_AXI_ADC_REG_CNTRL3_CRC_EN_MASK BIT(8)
ADI_AXI_ADC_CNTRL_3_CRC_EN_MASK
to match the existing naming pattern.
Also, add a comment that bit 8 is shared by all AXI ADC cores while bits
7-0 are custom per HDL project. (That is why they have names like AD485X
instead of AXI_ADC).
> +
> #define AXI_AD485X_CNTRL_3_OS_EN_MSK BIT(2)
> #define AXI_AD485X_CNTRL_3_PACKET_FORMAT_MSK GENMASK(1, 0)
> #define AXI_AD485X_PACKET_FORMAT_20BIT 0x0
> @@ -567,6 +569,22 @@ static int axi_adc_reg_access(struct iio_backend *back, unsigned int reg,
> return regmap_write(st->regmap, reg, writeval);
> }
>