All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@jic23.retrosnub.co.uk>
To: Sean Nyekjaer <sean@geanix.com>
Cc: linux-iio@vger.kernel.org, lorenzo.bianconi83@gmail.com,
	denis.ciocca@st.com, martin@geanix.com
Subject: Re: [RFC PATCH 0/3] io: imu: st_lsm6dsx: wake on acc event
Date: Sun, 16 Jun 2019 14:27:08 +0100	[thread overview]
Message-ID: <20190616142708.42e7c6f0@archlinux> (raw)
In-Reply-To: <20190616142431.111e6280@archlinux>

On Sun, 16 Jun 2019 14:24:31 +0100
Jonathan Cameron <jic23@kernel.org> wrote:

> On Fri, 14 Jun 2019 14:26:01 +0200
> Sean Nyekjaer <sean@geanix.com> wrote:
> 
> > Hi,
> > 
> > The first patch enables the wake event creation in the suspend function,
> > it hardcodes the accelerometer to low power mode and the gyro is powered down.
> > 
> > The second and third patch is where I have some questions.
> > Is it okay to create an sysfs entry that can enable and disable the wake
> > events from the accelerometer?  
> 
> On that I'm not sure - is there a standard way of configuring wake up events
> outside of IIO?
> 
> > 
> > The third patch is enabling us to set the threshold value.
> > Obviously this will need to be changed to represent a real value instead
> > of the raw register value.
> > Maybe I need to add a threshold avaliable sysfs entry?
> > Do I set it to a raw value calculated from the scale value or is some have
> > a better idea?  
> Yes, if a device is providing a _raw channel reading then threshold
> values should also be raw.
> 
> Available sysfs attribute makes sense if it helps a user, or userspace
> program to set the value.
> 
> > 
> > Finally is this the right approach to enable wake on accelerometer
> > events?
> > Please provide some idea's to how we could do it in the best and most
> > generic way.  
> 
> It's not something I've come across before, so hopefully someone else
> can provide guidance on this!
> 
> My only immediate thought is that perhaps this should be a device tree
> thing rather than userspace controlled?
doh. Should have read the patches first rather than just replying to the
cover letter ;) Ignore this bit!

> There also seems to be some existing infrastructure to control this
> in the power directory for a device.
> 
> Documentation/ABI/testing/sysfs-devices-power
> 
> Thanks,
> 
> Jonathan
> 
> > 
> > /Sean
> > 
> > Sean Nyekjaer (3):
> >   iio: imu: st_lsm6dsx: add wake on accelerometer threshold
> >   iio: imu: st_lsm6dsx: add wake on accelerometer enable hook in sysfs
> >   iio: imu: st_lsm6dsx: add wake on accelerometer threshold hook in
> >     sysfs
> > 
> >  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h      |   2 +
> >  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 135 +++++++++++++++++++
> >  2 files changed, 137 insertions(+)
> >   
> 


      reply	other threads:[~2019-06-16 13:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14 12:26 [RFC PATCH 0/3] io: imu: st_lsm6dsx: wake on acc event Sean Nyekjaer
2019-06-14 12:26 ` [RFC PATCH 1/3] iio: imu: st_lsm6dsx: add wake on accelerometer threshold Sean Nyekjaer
2019-06-15  8:30   ` Lorenzo Bianconi
2019-06-14 12:26 ` [RFC PATCH 2/3] iio: imu: st_lsm6dsx: add wake on accelerometer enable hook in sysfs Sean Nyekjaer
2019-06-15  8:38   ` Lorenzo Bianconi
2019-06-16 13:30   ` Jonathan Cameron
2019-06-17 16:29     ` Sean Nyekjaer
2019-06-14 12:26 ` [RFC PATCH 3/3] iio: imu: st_lsm6dsx: add wake on accelerometer threshold " Sean Nyekjaer
2019-06-15  8:35   ` Lorenzo Bianconi
2019-06-16 13:42     ` Jonathan Cameron
2019-06-16 13:24 ` [RFC PATCH 0/3] io: imu: st_lsm6dsx: wake on acc event Jonathan Cameron
2019-06-16 13:27   ` 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=20190616142708.42e7c6f0@archlinux \
    --to=jic23@jic23.retrosnub.co.uk \
    --cc=denis.ciocca@st.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=lorenzo.bianconi83@gmail.com \
    --cc=martin@geanix.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.