Re: [PATCH v2 3/5] iio: adc: adi-axi-adc: Support AXI ADA4355 IP core

From: Andy Shevchenko

Date: Mon Nov 30 2026 - 09:16:08 EST


On Fri, Nov 27, 2026 at 06:52:38PM -0300, Marcelo Schmitt wrote:
> The AXI ADA4355 IP core provides the HDL interface to ADA4355 devices. It
> differs from the generic AXI ADC core in its register layout and requires
> a data frame setup step in which the number of active serial lanes is
> programmed.
>
> Add a separate backend operation for the AXI ADA4355 IP core and register
> it as a new compatible of the adi-axi-adc driver.

> Link: https://analogdevicesinc.github.io/hdl/library/axi_ada4355/index.html

Don't put unreferred Link tags. Better to add a reference to the tag
(in a form of Link: $URL [1]) and use [1] in the commit message.

...

> +static int axi_adc_ada4355_calibration_source_set(struct iio_backend *back,
> + enum iio_backend_calib_source source,
> + unsigned int lane)
> +{
> + struct adi_axi_adc_state *st = iio_backend_get_priv(back);
> + u32 val;
> +
> + switch (source) {
> + case IIO_BACKEND_CALIB_SOURCE_NONE:
> + val = 0;
> + break;
> + case IIO_BACKEND_CALIB_SOURCE_FRAME:
> + val = ADI_AXI_ADC_LVDS_FRAME_ERROR;
> + break;
> + case IIO_BACKEND_CALIB_SOURCE_DATA_LANE:
> + if (BIT(lane) & ~ADI_AXI_ADC_LVDS_LANE_ERROR)
> + return -EINVAL;
> + val = BIT(lane);

Why not the opposite order?

val = BIT(lane);
if (val & ~ADI_AXI_ADC_LVDS_LANE_ERROR)
return -EINVAL;

since 'val' is local, it doesn't make any functional difference.

> + break;
> + default:
> + return -EINVAL;
> + }
> +
> + return regmap_update_bits(st->regmap, ADI_AXI_ADC_REG_LVDS,
> + ADI_AXI_ADC_LVDS_FRAME_ERROR |
> + ADI_AXI_ADC_LVDS_LANE_ERROR, val);
> +}

...

> { .compatible = "adi,axi-adc-10.0.a", .data = &adc_generic },
> { .compatible = "adi,axi-ad408x", .data = &adi_axi_ad408x },
> { .compatible = "adi,axi-ad485x", .data = &adi_axi_ad485x },
> { .compatible = "adi,axi-ad7606x", .data = &adc_ad7606 },
> + { .compatible = "adi,axi-ada4355", .data = &adi_axi_ada4355 },

I'm a bit puzzled with the ordering here, but despite the generic record,
the rest seems okay.

--
With Best Regards,
Andy Shevchenko