iio: adis: Support different burst sizes
authorNuno Sá <nuno.sa@analog.com>
Mon, 13 Apr 2020 08:24:43 +0000 (10:24 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 25 Apr 2020 15:11:56 +0000 (16:11 +0100)
commit3e04cb60e872b9433e523d62c39addf0bd1a18f1
tree6d5a33eb35e2973c78b81902e0c44b53a4f12f4a
parentb9c5eec725d67b548e4dfdc406d6ca2c6d30d1c2
iio: adis: Support different burst sizes

Add burst_max_len to `adis_burst`. This is useful for devices which
support different burst modes with different sizes. The buffer to be
used in the spi transfer is allocated with this variable making sure
that has space for all burst modes. The spi transfer length should hold
the "real" burst length depending on the current burst mode configured
in the device.

Moreover, `extra_len` in `adis_burst` is made const and it should
contain the smallest extra length necessary for a burst transfer. In
`struct adis` was added a new `burst_extra_len` that should hold the
extra bytes needed depending on the device instance being used.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/imu/adis16400.c
drivers/iio/imu/adis_buffer.c
include/linux/iio/imu/adis.h