Re: [PATCH 2/2] iio: adc: ad4080: configure backend data size
From: David Lechner
Date: Tue Jun 23 2026 - 19:07:57 EST
On 6/23/26 4:07 AM, Antoniu Miclaus wrote:
> The AXI backend needs to know the ADC word width in order to pack the
> sample data correctly on the bus. During channel setup, program the
> backend packet format via iio_backend_data_size_set() using the channel
> resolution, so the data is transferred according to the device's
> realbits.
>
Do we need a Fixes: tag?
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@xxxxxxxxxx>
> ---
> drivers/iio/adc/ad4080.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/iio/adc/ad4080.c b/drivers/iio/adc/ad4080.c
> index 8d2953341b15..8feb0c7f7fcb 100644
> --- a/drivers/iio/adc/ad4080.c
> +++ b/drivers/iio/adc/ad4080.c
> @@ -698,6 +698,11 @@ static int ad4080_setup_channel(struct ad4080_state *st, unsigned int ch)
> if (ret)
> return ret;
>
> + ret = iio_backend_data_size_set(st->back[ch],
> + st->info->channels[0].scan_type.realbits);
> + if (ret)
> + return ret;
> +
> if (!st->lvds_cnv_en)
> return 0;
>