Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: lorenzo.bianconi@redhat.com, linux-iio@vger.kernel.org,
	mario.tesi@st.com
Subject: Re: [PATCH] iio: imu: st_lsm6dsx: introduce sw trigger support
Date: Sun, 6 Nov 2022 12:01:07 +0000	[thread overview]
Message-ID: <20221106120107.00a73102@jic23-huawei> (raw)
In-Reply-To: <Y11wZ9yGCmOMAf/x@lore-desk>

...

> > > +static irqreturn_t st_lsm6dsx_sw_trigger_handler_thread(int irq,
> > > +							void *private)
> > > +{
> > > +	struct iio_poll_func *pf = private;
> > > +	struct iio_dev *iio_dev = pf->indio_dev;
> > > +	struct st_lsm6dsx_sensor *sensor = iio_priv(iio_dev);
> > > +	struct st_lsm6dsx_hw *hw = sensor->hw;
> > > +
> > > +	if (sensor->id == ST_LSM6DSX_ID_EXT0 ||
> > > +	    sensor->id == ST_LSM6DSX_ID_EXT1 ||
> > > +	    sensor->id == ST_LSM6DSX_ID_EXT2)
> > > +		st_lsm6dsx_shub_read_output(hw,
> > > +					    (u8 *)hw->scan[sensor->id].channels,
> > > +					    sizeof(hw->scan[sensor->id].channels));  
> > 
> > Are we guaranteed this particular size of readback?  I'm guessing a bit
> > as it's been a long time since I looked at this driver in detail, but could
> > we have sensors with either a different number of axes or different number
> > of registers per axis?
> > 
> > It might be neater to have two handlers, one for the EXTN cases and one
> > for the main sensors.  That would push this conditional down to the
> > point of registration.  I'm not sure it's worth it however so up to you...  
> 
> Hi Jonathan,
> 
> so far we support just magnetometers on sensor-hub (LIS2MDL and LIS3MDL).
> Both LIS2MDL and LIS3MDL have 3 axis, each of them is le16, so it is fine as it
> is for the moment. Do you prefer to be more generic and take into account new
> possible sensors? I am not sure when they will arrive :)

Fine as it stands.  You've thought about it and decided to postpone such a
change until it is necessary and that's fine by me.

Applied to the togreg branch of iio.git and pushed out as testing for 0-day
to poke at the tree and see if we missed anything.

Thanks,

Jonathan

      reply	other threads:[~2022-11-06 12:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-28 11:23 [PATCH] iio: imu: st_lsm6dsx: introduce sw trigger support Lorenzo Bianconi
2022-10-29 15:20 ` Jonathan Cameron
2022-10-29 18:26   ` Lorenzo Bianconi
2022-11-06 12:01     ` Jonathan Cameron [this message]

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=20221106120107.00a73102@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=lorenzo@kernel.org \
    --cc=mario.tesi@st.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