Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio:imu:adis16480: fix buffering for devices with no burst mode

The trigger handler defined in the driver assumes that burst mode is
being used. Hence, for devices that do not support it, we have to use
the adis library default trigger implementation.

Tested-by: Julia Pineda <julia.pineda@analog.com>
Fixes: 941f130881fa9 ("iio: adis16480: support burst read function")
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20220114132608.241-1-nuno.sa@analog.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Nuno Sá and committed by
Jonathan Cameron
b0e85f95 0e33d15f

+6 -1
+6 -1
drivers/iio/imu/adis16480.c
··· 1403 1403 { 1404 1404 const struct spi_device_id *id = spi_get_device_id(spi); 1405 1405 const struct adis_data *adis16480_data; 1406 + irq_handler_t trigger_handler = NULL; 1406 1407 struct iio_dev *indio_dev; 1407 1408 struct adis16480 *st; 1408 1409 int ret; ··· 1475 1474 st->clk_freq = st->chip_info->int_clk; 1476 1475 } 1477 1476 1477 + /* Only use our trigger handler if burst mode is supported */ 1478 + if (adis16480_data->burst_len) 1479 + trigger_handler = adis16480_trigger_handler; 1480 + 1478 1481 ret = devm_adis_setup_buffer_and_trigger(&st->adis, indio_dev, 1479 - adis16480_trigger_handler); 1482 + trigger_handler); 1480 1483 if (ret) 1481 1484 return ret; 1482 1485