Skip to content

Commit b0e85f9

Browse files
nunojsaJonathan Cameron
authored andcommitted
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: 941f130 ("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>
1 parent 0e33d15 commit b0e85f9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎drivers/iio/imu/adis16480.c‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1403,6 +1403,7 @@ static int adis16480_probe(struct spi_device *spi)
14031403
{
14041404
const struct spi_device_id *id = spi_get_device_id(spi);
14051405
const struct adis_data *adis16480_data;
1406+
irq_handler_t trigger_handler = NULL;
14061407
struct iio_dev *indio_dev;
14071408
struct adis16480 *st;
14081409
int ret;
@@ -1474,8 +1475,12 @@ static int adis16480_probe(struct spi_device *spi)
14741475
st->clk_freq = st->chip_info->int_clk;
14751476
}
14761477

1478+
/* Only use our trigger handler if burst mode is supported */
1479+
if (adis16480_data->burst_len)
1480+
trigger_handler = adis16480_trigger_handler;
1481+
14771482
ret = devm_adis_setup_buffer_and_trigger(&st->adis, indio_dev,
1478-
adis16480_trigger_handler);
1483+
trigger_handler);
14791484
if (ret)
14801485
return ret;
14811486

0 commit comments

Comments
 (0)