summaryrefslogtreecommitdiff
path: root/drivers/iio
diff options
context:
space:
mode:
authorNuno Sá <nuno.sa@analog.com>2022-01-14 16:26:08 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-03-02 13:48:03 +0300
commit7bdf7d5f0cbdd18a986ae3023a4c9bb2eaa6ef8d (patch)
tree800eb8b0b47706684ea9147580396ed2a7c54375 /drivers/iio
parent9000406481a5a4d7469e021adaf19f7245609cd7 (diff)
downloadlinux-7bdf7d5f0cbdd18a986ae3023a4c9bb2eaa6ef8d.tar.xz
iio:imu:adis16480: fix buffering for devices with no burst mode
commit b0e85f95e30d4d2dc22ea123a30dba36406879a1 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/imu/adis16480.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c
index ed129321a14d..f9b4540db1f4 100644
--- a/drivers/iio/imu/adis16480.c
+++ b/drivers/iio/imu/adis16480.c
@@ -1403,6 +1403,7 @@ static int adis16480_probe(struct spi_device *spi)
{
const struct spi_device_id *id = spi_get_device_id(spi);
const struct adis_data *adis16480_data;
+ irq_handler_t trigger_handler = NULL;
struct iio_dev *indio_dev;
struct adis16480 *st;
int ret;
@@ -1474,8 +1475,12 @@ static int adis16480_probe(struct spi_device *spi)
st->clk_freq = st->chip_info->int_clk;
}
+ /* Only use our trigger handler if burst mode is supported */
+ if (adis16480_data->burst_len)
+ trigger_handler = adis16480_trigger_handler;
+
ret = devm_adis_setup_buffer_and_trigger(&st->adis, indio_dev,
- adis16480_trigger_handler);
+ trigger_handler);
if (ret)
return ret;