All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Martin Fuzzey <mfuzzey@parkeon.com>,
	linux-iio@vger.kernel.org, Peter Meerwald <pmeerw@pmeerw.net>
Subject: Re: [PATCH 4/9] iio: mma8452: Basic support for transient events.
Date: Tue, 12 May 2015 20:08:05 +0100	[thread overview]
Message-ID: <55524F95.5040409@kernel.org> (raw)
In-Reply-To: <55520AD8.5070100@parkeon.com>

On 12/05/15 15:14, Martin Fuzzey wrote:
> On 08/05/15 15:58, Jonathan Cameron wrote:
>> On 29/04/15 08:52, Martin Fuzzey wrote:
>>> On 25/02/15 13:25, Jonathan Cameron wrote:
>>>> On 19/02/15 14:16, Martin Fuzzey wrote:
>>>>> The event is triggered when the highpass filtered absolute acceleration
>>>>> exceeds the threshold.
>>>>>
>>>>> Signed-off-by: Martin Fuzzey <mfuzzey@parkeon.com>
>>>> you in_accel_transient_scale isn't documented.
>>>> Why do we need this naming at all?
>>>> Ah. It's not clear this is just the event rather than the underlying channel.
>>> Sorry, not understanding you here.
>>>
>>> Are you saying it's not clear in the documentation (which is the next
>>> patch "iio: doc: Describe scale attributes for event thresholds" that
>>> you've already applied) or in the code?
>> oops, I suspect I didn't like the naming of the attribute being somewhat
>> ambiguous.
>>
>> Also, whilst the next patch is documentation, it doesn't seem to include
>> this particular attribute...
> 
> Ah, I think you are confusing the attribute name and the local variable name.
> in_accel_transient_scale is just the local variable name.
> 
> The attribute name is events/in_accel_scale and that is documented in the patch you have already merged.
Gah! fair enough.  I'm easily confused ;)
> 
> 
> $ git show d1bd4867b0959d5221dc528ccf60c8534aae865d
> commit d1bd4867b0959d5221dc528ccf60c8534aae865d
> Author: Martin Fuzzey <mfuzzey@parkeon.com>
> Date:   Thu Feb 19 15:16:04 2015 +0100
> 
>     iio: doc: Describe scale attributes for event thresholds
> 
>     Signed-off-by: Martin Fuzzey <mfuzzey@parkeon.com>
>     Signed-off-by: Jonathan Cameron <jic23@kernel.org>
> 
> diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
> index 9a70c31..9230709 100644
> --- a/Documentation/ABI/testing/sysfs-bus-iio
> +++ b/Documentation/ABI/testing/sysfs-bus-iio
> @@ -661,6 +661,24 @@ Description:
>                 value is in raw device units or in processed units (as _raw
>                 and _input do on sysfs direct channel read attributes).
> 
> +What:          /sys/.../events/in_accel_scale
> ...
> 
> 
>>> The code is:
>>> /*
>>>   * Threshold is configured in fixed 8G/127 steps regardless of
>>>   * currently selected scale for measurement.
>>>   */
>>> static IIO_CONST_ATTR_NAMED(accel_transient_scale, in_accel_scale, "0.617742");
>>>
>>> static struct attribute *mma8452_event_attributes[] = {
>>>      &iio_const_attr_accel_transient_scale.dev_attr.attr,
>>>      NULL,
>>> };
>>>
>>> static struct attribute_group mma8452_event_attribute_group = {
>>>      .attrs = mma8452_event_attributes,
>>>      .name = "events",
>>> };
>>>
>>> #define MMA8452_CHANNEL(axis, idx) { \
>>>      .type = IIO_ACCEL, \
>>> ...
>>>      .num_event_specs = ARRAY_SIZE(mma8452_transient_event), \
>>> }
>>>
>>>
>>> That seems fairly clear to me.
>>>
>>>> Perhaps, make it an event parameter instead... e.g. add scale to the ev_info
>>>> array like we do for hysteresis etc.
>>> But doing that would create a read/write attribute in sysfs whereas the above code creates a read only attribute and makes it clear that the attribute is a constant through the use of IIO_CONST_ATTR_NAMED
>>>
>>> Once this is sorted out I'll send another (hopefully last) respin with the remaining remarks fixed.
>>>
>>> Regards,
>>>
>>> Martin
>>>
>>>> Otherwise, looks good to me.
>>>>
>>>> Again, Peter's input would be good.
>>>>
>>>>
> 


  reply	other threads:[~2015-05-12 19:08 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-19 14:15 [PATCH V3 0/9] iio: mma8452 enhancements Martin Fuzzey
2015-02-19 14:15 ` [PATCH 1/9] iio: mma8452: Initialise before activating Martin Fuzzey
2015-02-25 12:12   ` Jonathan Cameron
2015-02-25 23:05   ` Peter Meerwald
2015-04-16 20:34   ` Hartmut Knaack
2015-02-19 14:15 ` [PATCH 2/9] iio: mma8452: Add access to registers via DebugFS Martin Fuzzey
2015-04-16 20:50   ` Hartmut Knaack
2015-02-19 14:16 ` [PATCH 3/9] iio: core: add high pass filter attributes Martin Fuzzey
2015-04-16 21:05   ` Hartmut Knaack
2015-02-19 14:16 ` [PATCH 4/9] iio: mma8452: Basic support for transient events Martin Fuzzey
2015-02-25 12:25   ` Jonathan Cameron
2015-04-29 12:52     ` Martin Fuzzey
2015-05-08 13:58       ` Jonathan Cameron
2015-05-12 14:14         ` Martin Fuzzey
2015-05-12 19:08           ` Jonathan Cameron [this message]
2015-02-25 23:09   ` Peter Meerwald
2015-04-16 22:30   ` Hartmut Knaack
2015-02-19 14:16 ` [PATCH 5/9] iio: doc: Describe scale attributes for event thresholds Martin Fuzzey
2015-03-09 13:31   ` Jonathan Cameron
2015-04-16 22:36     ` Hartmut Knaack
2015-04-18 11:24       ` Jonathan Cameron
2015-02-19 14:16 ` [PATCH 6/9] iio: mma8452: Add support for transient event debouncing Martin Fuzzey
2015-04-17 21:47   ` Hartmut Knaack
2015-02-19 14:16 ` [PATCH 7/9] iio: mma8452: Add highpass filter configuration Martin Fuzzey
2015-02-25 22:45   ` Peter Meerwald
2015-02-19 14:16 ` [PATCH 8/9] iio: mma8452: Add support for interrupt driven triggers Martin Fuzzey
2015-02-19 14:16 ` [PATCH 9/9] iio: mma8452: add support for self test Martin Fuzzey
2015-02-25 22:54   ` Peter Meerwald
2015-03-09 13:37   ` Jonathan Cameron
2015-04-29  8:05     ` Martin Fuzzey
2015-05-07 23:13       ` Jonathan Cameron
2015-02-25 23:11 ` [PATCH V3 0/9] iio: mma8452 enhancements Peter Meerwald
2015-03-09 13:49   ` 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=55524F95.5040409@kernel.org \
    --to=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=mfuzzey@parkeon.com \
    --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 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.