public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Nyekjaer <sean@geanix.com>
To: linux-iio@vger.kernel.org, jic23@kernel.org
Cc: Sean Nyekjaer <sean@geanix.com>, martin@geanix.com
Subject: [PATCH 1/2] iio: imu: st_lsm6dsx: only set available_scan_masks if using device fifo
Date: Tue,  7 May 2019 10:02:24 +0200	[thread overview]
Message-ID: <20190507080225.108000-1-sean@geanix.com> (raw)

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


             reply	other threads:[~2019-05-07  8:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-07  8:02 Sean Nyekjaer [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190507080225.108000-1-sean@geanix.com \
    --to=sean@geanix.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=martin@geanix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox