linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] iio: imu: st_lsm6dsx: only set available_scan_masks if using device fifo
@ 2019-05-07  8:02 Sean Nyekjaer
  2019-05-07  8:02 ` [PATCH 2/2] iio: imu: st_lsm6dsx: add iio trigger and buffer support Sean Nyekjaer
  0 siblings, 1 reply; 9+ messages in thread
From: Sean Nyekjaer @ 2019-05-07  8:02 UTC (permalink / raw)
  To: linux-iio, jic23; +Cc: Sean Nyekjaer, martin

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 --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);
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-05-18  8:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-07  8:02 [PATCH 1/2] iio: imu: st_lsm6dsx: only set available_scan_masks if using device fifo Sean Nyekjaer
2019-05-07  8:02 ` [PATCH 2/2] iio: imu: st_lsm6dsx: add iio trigger and buffer support Sean Nyekjaer
2019-05-11 11:37   ` Jonathan Cameron
2019-05-11 12:30     ` Lorenzo Bianconi
2019-05-11 12:54       ` Sean Nyekjaer
2019-05-11 17:00         ` Lorenzo Bianconi
2019-05-16 11:46           ` Sean Nyekjaer
2019-05-18  8:38           ` Jonathan Cameron
2019-05-11 12:38     ` Sean Nyekjaer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).