• Paul Cercueil's avatar
    iio: adis16400: Fix burst mode · 7ed21d68
    Paul Cercueil authored
    commit 9df56035 upstream.
    
    There are a few issues with the burst mode support. For one we don't setup
    the rx buffer, so the buffer will never be filled and all samples will read
    as the zero. Furthermore the tx buffer has the wrong type, which means the
    driver sends the wrong command and not the right data is returned.
    
    The final issue is that in burst mode all channels are transferred. Hence
    the length of the transfer length should be the number of hardware
    channels * 2 bytes. Currently the driver uses indio_dev->scan_bytes for
    this. But if the timestamp channel is enabled the scan_bytes will be larger
    than the burst length. Fix this by just calculating the burst length based
    on the number of hardware channels.
    Signed-off-by: default avatarPaul Cercueil <paul.cercueil@analog.com>
    Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
    Fixes: 5eda3550 ("staging:iio:adis16400: Preallocate transfer message")
    Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    7ed21d68
adis16400_buffer.c 2.27 KB