Re: [PATCH v2 3/7] iio: adc: ad4170: Add support for buffered data capture

Marcelo Schmitt
2025-04-30T13:39:05Z

Hi Andy, thank you for your review.

...
> > +static int ad4170_prepare_spi_message(struct ad4170_state *st)
> > +{
> > + /*
> > + * Continuous data register read is enabled on buffer postenable so
> > + * no instruction phase is needed meaning we don't need to send the
> > + * register address to read data. Transfer only needs the read buffer.
> > + */
> > + st->xfer.rx_buf = &st->rx_buf;
> > + st->xfer.len = BITS_TO_BYTES(ad4170_channel_template.scan_type.realbits);
>
> This will give, e.g., 3 for the realbits == 24. Is this expected?

Yes, in continuous read mode the ADC outputs just the conversion result bits
(24-bits) so a 3-byte length transfer is enough to get the conversion data for a
channel.

>
...
>
> > + return dev_err_probe(&st->spi->dev, ret,
> > + "Failed to register trigger\n");
>
> One line?

It goes up to 89 columns if make in one line. I know there are other places in
this driver where 80 columns are exceeded, but in this case it's easier to
avoid going beyond 80 columns without drying up the error message.
Anyway, I'll make it one line if it's confirmed to be the preferable way to have
it.

Thanks,
Marcelo