Re: [PATCH v4 9/9] iio: adc: ad7380: add support for multiple SPI lanes
From: Marcelo Schmitt
Date: Thu Jan 08 2026 - 08:20:33 EST
On 12/19, David Lechner wrote:
> Add support for multiple SPI lanes to increase throughput. The AD7380
> family of ADCs have multiple SDO lines on the chip that can be used to
> read each channel on a separate SPI lane. If wired up to a SPI
> controller that supports it, the driver will now take advantage of this
> feature. This allows reaching the maximum sample rate advertised in the
> datasheet when combined with SPI offloading.
>
> Reviewed-by: Nuno Sá <nuno.sa@xxxxxxxxxx>
> Signed-off-by: David Lechner <dlechner@xxxxxxxxxxxx>
> ---
...
> st->sample_freq_range[0] = 1; /* min */
> st->sample_freq_range[1] = 1; /* step */
> @@ -1887,6 +1899,11 @@ static int ad7380_probe(struct spi_device *spi)
> if (!st->chip_info)
> return dev_err_probe(dev, -EINVAL, "missing match data\n");
>
> + st->num_sdo_lines = spi->num_rx_lanes;
> +
> + if (st->num_sdo_lines < 1 || st->num_sdo_lines > st->chip_info->num_simult_channels)
> + return dev_err_probe(dev, -EINVAL, "invalid number of SDO lines\n");
> +
Maybe also print st->num_sdo_lines here?
Nevertheless,
Reviewed-by: Marcelo Schmitt <marcelo.schmitt@xxxxxxxxxx>
> ret = devm_regulator_bulk_get_enable(dev, st->chip_info->num_supplies,
> st->chip_info->supplies);
>