diff mbox series

[1/2] iio: imu: st_lsm6dsx: only set available_scan_masks if using device fifo

Message ID 20190507080225.108000-1-sean@geanix.com (mailing list archive)
State New, archived
Headers show
Series [1/2] iio: imu: st_lsm6dsx: only set available_scan_masks if using device fifo | expand

Commit Message

Sean Nyekjaer May 7, 2019, 8:02 a.m. UTC
We only need available scan_masks set if we are going to use the
onboard fifo. Unfortunately it requires the IRQ pins to be connected
to the SoC.
The next patch in this series add support for iio triggered buffer
for use with iio triggers.

Signed-off-by: Sean Nyekjaer <sean@geanix.com>
---
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
index cf82c9049945..1ca69598678f 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
@@ -1007,7 +1007,6 @@  static struct iio_dev *st_lsm6dsx_alloc_iiodev(struct st_lsm6dsx_hw *hw,
 
 	iio_dev->modes = INDIO_DIRECT_MODE;
 	iio_dev->dev.parent = hw->dev;
-	iio_dev->available_scan_masks = st_lsm6dsx_available_scan_masks;
 
 	sensor = iio_priv(iio_dev);
 	sensor->id = id;
@@ -1074,6 +1073,9 @@  int st_lsm6dsx_probe(struct device *dev, int irq, int hw_id, const char *name,
 		hw->iio_devs[i] = st_lsm6dsx_alloc_iiodev(hw, i, name);
 		if (!hw->iio_devs[i])
 			return -ENOMEM;
+
+		hw->iio_devs[i]->available_scan_masks =
+				 st_lsm6dsx_available_scan_masks;
 	}
 
 	err = st_lsm6dsx_init_device(hw);