linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Martin Kepplinger <martink@posteo.de>
Cc: harinath Nampally <harinath922@gmail.com>,
	knaack.h@gmx.de, lars@metafoo.de,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Greg KH <gregkh@linuxfoundation.org>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Alison Schofield <amsfield22@gmail.com>
Subject: Re: [PATCH v5] iio: accel: mma8452: improvements to handle multiple events
Date: Sun, 10 Sep 2017 16:27:49 +0100	[thread overview]
Message-ID: <20170910162749.2d8743cf@archlinux> (raw)
In-Reply-To: <71459A58-C26C-4956-B8E6-655841F219CB@posteo.de>

On Sun, 10 Sep 2017 16:00:35 +0200
Martin Kepplinger <martink@posteo.de> wrote:

> Am 10. September 2017 15:44:24 MESZ schrieb Jonathan Cameron <jic23@kernel.org>:
> >On Mon, 4 Sep 2017 23:06:37 -0400
> >harinath Nampally <harinath922@gmail.com> wrote:
> >  
> >> > I agree with your understanding.  It's a rising threshold, just  
> >that the input  
> >> > will only reflect high frequency changes in the signal.    
> >> Thank you for the clarification. I am hoping this gets merged in the
> >> next window if no other issues.  
> >
> >There is still the open question to Martin on what he meant in his
> >review to be addressed.
> >
> >Martin, any comments on this?
> >
> >I'm really looking for an OK from Martin before I take this one.
> >Plenty of time though given the merge window is still open!  
> 
> I had a look at v6 of this.
> 
doh. I hadn't registered there was a v6!
> >
> >I'm travelling this week so response may be a bit random depending
> >on conference wifi and how interesting the material is ;)  
> 
> enjoy,

Thanks ;)
> 
>     martin
> 
> >
> >Jonathan
> >  
> >> 
> >> Thanks,
> >> Hari
> >> 
> >> On Sun, Sep 3, 2017 at 12:24 PM, Jonathan Cameron <jic23@kernel.org>  
> >wrote:  
> >> > On Tue, 29 Aug 2017 23:01:16 -0400
> >> > harinath Nampally <harinath922@gmail.com> wrote:
> >> >    
> >> >> > We should never say "transient is for rising
> >> >> > direction" or "ff_mt is for falling direction". any combination  
> >is fine.    
> >> >>
> >> >> Ok I agree that there is no hard and fast rule that "transient is  
> >for rising  
> >> >> direction" or "ff_mt is for falling direction".
> >> >> But in our case, datasheet for these chips define these events  
> >based on  
> >> >> acceleration magnitude rising or falling below a set threshold  
> >value.  
> >> >>
> >> >> For quick reference, below excerpts are from fxls8471 datasheet:
> >> >> Motion Event: "When the acceleration exceeds a set threshold for a  
> >set  
> >> >> amount of time,
> >> >> the motion interrupt is asserted."
> >> >>
> >> >> Freefall event: "The detection of “Freefall” involves the  
> >monitoring  
> >> >> of the X, Y, and Z axes
> >> >> for the condition where the acceleration magnitude is below a
> >> >> user-specified threshold
> >> >> for a user-definable amount of time"
> >> >>
> >> >> Transient event: "When the high-pass filter is bypassed, the
> >> >> functionality becomes
> >> >> similar to the motion-detection function; in this mode,  
> >acceleration  
> >> >> greater than
> >> >> a programmable threshold is detected (along an axis)."
> >> >>
> >> >> Therefore I think in this driver freefall event is defined as
> >> >> 'falling' event type and
> >> >> motion event is defined as 'rising' event type and Transient is  
> >also defined as  
> >> >> 'rising' event type.
> >> >>  As you might already know that mma8562 and mma8563 doesn't have
> >> >> transient event support
> >> >> but they do have freefall and motion event support which are  
> >defined  
> >> >> as 'fall' and 'rise'
> >> >> event types respectively. Please note in this driver, motion event  
> >is  
> >> >> enabled/configured only
> >> >> for mma8652 and mma8653.
> >> >> Therefore if I read/write sysfs node for 'rise' it should use the
> >> >> FF_MT registers for mma8652 and mma853, but for all others like
> >> >> mma8451, mma8452 and
> >> >> mma8453 which has transient event support it picks the Transient
> >> >> registers if enabled. Also please
> >> >> note transient event is enabled(but not motion event) for mma8451,
> >> >> mma8452 and mma8453.
> >> >> The problem seems like we have two different events(motion and
> >> >> transient) that are defined
> >> >> as same event type 'rising' but in fact both motion and transient  
> >are  
> >> >> pretty much similar as they
> >> >> both raise interrupt flag when the acceleration magnitude rises  
> >above  
> >> >> the threshold.
> >> >> Only difference is transient event has its own event config  
> >registers  
> >> >> with High pass filter.
> >> >> If HPF bypassed using config register transient event acts like  
> >motion  
> >> >> detection event.    
> >> >    
> >> >>
> >> >> That was my understanding but please correct me if I am wrong.    
> >> >
> >> > I agree with your understanding.  It's a rising threshold, just  
> >that the input  
> >> > will only reflect high frequency changes in the signal.
> >> >    
> >> >>    
> >> >> > Only freefall mode needs one fix: remembering to which set of  
> >registers to fall back when  
> >> >> > disabling it.    
> >> >>
> >> >> I don't quite understand what you mean by 'to fall back when  
> >disabling  
> >> >> it'. Please elaborate. I would
> >> >> appreciate if you could suggest your logic in the form of  
> >pseudo-code.  
> >> >> Thanks for your time
> >> >>    
> >> > ...    
> 


      reply	other threads:[~2017-09-10 15:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-28  0:23 [PATCH v5] iio: accel: mma8452: improvements to handle multiple events Harinath Nampally
2017-08-28  6:46 ` Martin Kepplinger
2017-08-30  2:55   ` harinath Nampally
2017-08-30  3:01     ` harinath Nampally
2017-09-03 16:24       ` Jonathan Cameron
2017-09-05  3:06         ` harinath Nampally
2017-09-10 13:44           ` Jonathan Cameron
2017-09-10 14:00             ` Martin Kepplinger
2017-09-10 15: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=20170910162749.2d8743cf@archlinux \
    --to=jic23@kernel.org \
    --cc=amsfield22@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=harinath922@gmail.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martink@posteo.de \
    --cc=pmeerw@pmeerw.net \
    /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;
as well as URLs for NNTP newsgroup(s).