public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Sean Nyekjaer <sean@geanix.com>
Cc: Lorenzo Bianconi <lorenzo@kernel.org>,
	lorenzo.bianconi@redhat.com, linux-iio@vger.kernel.org,
	mario.tesi@st.com, armando.visconti@st.com, denis.ciocca@st.com
Subject: Re: [PATCH 1/2] iio: imu: st_lsm6dsx: enable LIR for sensor events
Date: Sun, 15 Sep 2019 11:57:06 +0100	[thread overview]
Message-ID: <20190915115706.3d1adb1e@archlinux> (raw)
In-Reply-To: <9e55d2f6-5136-f783-bec6-bae79dbc59d2@geanix.com>

On Wed, 11 Sep 2019 14:37:23 +0200
Sean Nyekjaer <sean@geanix.com> wrote:

> On 11/09/2019 08.50, Lorenzo Bianconi wrote:
> > Enable Latched interrupt by default for sensor events
> > 
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>  
> Tested-by: Sean Nyekjaer <sean@geanix.com>

Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to play with it.

Thanks,

Jonathan

> > ---
> >   drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h      |  2 ++
> >   drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 35 ++++++++++++++++++++
> >   2 files changed, 37 insertions(+)
> > 
> > diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> > index 5e3cd96b0059..3ea0dc13d101 100644
> > --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> > +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> > @@ -215,6 +215,7 @@ struct st_lsm6dsx_ext_dev_settings {
> >    * @fs_table: Hw sensors gain table (gain + val).
> >    * @decimator: List of decimator register info (addr + mask).
> >    * @batch: List of FIFO batching register info (addr + mask).
> > + * @lir: Latched interrupt register info (addr + mask).
> >    * @fifo_ops: Sensor hw FIFO parameters.
> >    * @ts_settings: Hw timer related settings.
> >    * @shub_settings: i2c controller related settings.
> > @@ -237,6 +238,7 @@ struct st_lsm6dsx_settings {
> >   	struct st_lsm6dsx_fs_table_entry fs_table[2];
> >   	struct st_lsm6dsx_reg decimator[ST_LSM6DSX_MAX_ID];
> >   	struct st_lsm6dsx_reg batch[ST_LSM6DSX_MAX_ID];
> > +	struct st_lsm6dsx_reg lir;
> >   	struct st_lsm6dsx_fifo_ops fifo_ops;
> >   	struct st_lsm6dsx_hw_ts_settings ts_settings;
> >   	struct st_lsm6dsx_shub_settings shub_settings;
> > diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> > index 2d3495560136..a208da865efe 100644
> > --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> > +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> > @@ -237,6 +237,10 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
> >   				.mask = GENMASK(5, 3),
> >   			},
> >   		},
> > +		.lir = {
> > +			.addr = 0x58,
> > +			.mask = BIT(0),
> > +		},
> >   		.fifo_ops = {
> >   			.update_fifo = st_lsm6dsx_update_fifo,
> >   			.read_fifo = st_lsm6dsx_read_fifo,
> > @@ -349,6 +353,10 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
> >   				.mask = GENMASK(5, 3),
> >   			},
> >   		},
> > +		.lir = {
> > +			.addr = 0x58,
> > +			.mask = BIT(0),
> > +		},
> >   		.fifo_ops = {
> >   			.update_fifo = st_lsm6dsx_update_fifo,
> >   			.read_fifo = st_lsm6dsx_read_fifo,
> > @@ -470,6 +478,10 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
> >   				.mask = GENMASK(5, 3),
> >   			},
> >   		},
> > +		.lir = {
> > +			.addr = 0x58,
> > +			.mask = BIT(0),
> > +		},
> >   		.fifo_ops = {
> >   			.update_fifo = st_lsm6dsx_update_fifo,
> >   			.read_fifo = st_lsm6dsx_read_fifo,
> > @@ -585,6 +597,10 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
> >   				.mask = GENMASK(7, 4),
> >   			},
> >   		},
> > +		.lir = {
> > +			.addr = 0x56,
> > +			.mask = BIT(0),
> > +		},
> >   		.fifo_ops = {
> >   			.update_fifo = st_lsm6dsx_update_fifo,
> >   			.read_fifo = st_lsm6dsx_read_tagged_fifo,
> > @@ -715,6 +731,10 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
> >   				.mask = GENMASK(7, 4),
> >   			},
> >   		},
> > +		.lir = {
> > +			.addr = 0x56,
> > +			.mask = BIT(0),
> > +		},
> >   		.fifo_ops = {
> >   			.update_fifo = st_lsm6dsx_update_fifo,
> >   			.read_fifo = st_lsm6dsx_read_tagged_fifo,
> > @@ -822,6 +842,10 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
> >   				.mask = GENMASK(7, 4),
> >   			},
> >   		},
> > +		.lir = {
> > +			.addr = 0x56,
> > +			.mask = BIT(0),
> > +		},
> >   		.fifo_ops = {
> >   			.update_fifo = st_lsm6dsx_update_fifo,
> >   			.read_fifo = st_lsm6dsx_read_tagged_fifo,
> > @@ -1416,6 +1440,17 @@ static int st_lsm6dsx_init_device(struct st_lsm6dsx_hw *hw)
> >   	if (err < 0)
> >   		return err;
> >   
> > +	/* enable Latched interrupts for device events */
> > +	if (hw->settings->lir.addr) {
> > +		unsigned int data;
> > +
> > +		data = ST_LSM6DSX_SHIFT_VAL(1, hw->settings->lir.mask);
> > +		err = regmap_update_bits(hw->regmap, hw->settings->lir.addr,
> > +					 hw->settings->lir.mask, data);
> > +		if (err < 0)
> > +			return err;
> > +	}
> > +
> >   	err = st_lsm6dsx_init_shub(hw);
> >   	if (err < 0)
> >   		return err;
> >   


  reply	other threads:[~2019-09-15 10:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-11  6:50 [PATCH 0/2] enable LIR and clear_on_read for st_lsm6dsx Lorenzo Bianconi
2019-09-11  6:50 ` [PATCH 1/2] iio: imu: st_lsm6dsx: enable LIR for sensor events Lorenzo Bianconi
2019-09-11 12:37   ` Sean Nyekjaer
2019-09-15 10:57     ` Jonathan Cameron [this message]
2019-09-11  6:50 ` [PATCH 2/2] iio: imu: st_lsm6dsx: enable clear on read for latched interrupts Lorenzo Bianconi
2019-09-11 12:37   ` Sean Nyekjaer
2019-09-15 11:03     ` Jonathan Cameron

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=20190915115706.3d1adb1e@archlinux \
    --to=jic23@kernel.org \
    --cc=armando.visconti@st.com \
    --cc=denis.ciocca@st.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=lorenzo@kernel.org \
    --cc=mario.tesi@st.com \
    --cc=sean@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