]> git.baikalelectronics.ru Git - kernel.git/commit
iio: adis16400: Fix burst mode
authorPaul Cercueil <paul.cercueil@analog.com>
Fri, 15 May 2015 15:18:37 +0000 (17:18 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sat, 16 May 2015 10:00:50 +0000 (11:00 +0100)
commitbcf9ef80b720058194245e2cbdf346b0446e4bb9
tree1cbb294399294c3ef35dbd44a4059c6dde2e7165
parent40f598674afe8495062956cd55e732c35aa02529
iio: adis16400: Fix burst mode

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: Paul Cercueil <paul.cercueil@analog.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Fixes: 4236e0f6af95 ("staging:iio:adis16400: Preallocate transfer message")
Cc: <stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/imu/adis16400_buffer.c