Re: [PATCH RFC v6 10/10] iio: adc: ad7380: add support for resolution boost

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 1, 2024 at 9:56 AM Julien Stephan <jstephan@xxxxxxxxxxxx> wrote:
>

...

>
> +static int ad7380_prepare_spi_xfer(struct ad7380_state *st, struct spi_transfer *xfer)
> +{
> +       int bits_per_word;
> +
> +       memset(xfer, 0, sizeof(*xfer));
> +
> +       xfer->rx_buf = &st->scan_data.raw;
> +
> +       if (st->resolution_boost_enable == RESOLUTION_BOOST_ENABLE)
> +               bits_per_word = st->chip_info->channels[0].scan_type.realbits;
> +       else
> +               bits_per_word = st->chip_info->channels[0].scan_type.realbits - 2;
> +
> +       xfer->bits_per_word = bits_per_word;
> +
> +       xfer->len = (st->chip_info->num_channels - 1) * BITS_TO_BYTES(bits_per_word);

This needs to be based on storagebits, not realbits.

> +
> +       return bits_per_word;
> +}
> +





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux