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

Jonathan Cameron
2025-05-04T17:27:17Z

On Wed, 30 Apr 2025 10:40:21 -0300
Marcelo Schmitt <marcelo.schmitt1@gmail.com> wrote:

> 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.
In here there are what I think are multiple ways to get to the same ultimate
device. (indio->dev.parent is used the line above). Better perhaps to
have one 'dev' that is appropriate for use in both places.

>
> Thanks,
> Marcelo
>