From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753396AbbAYXHq (ORCPT ); Sun, 25 Jan 2015 18:07:46 -0500 Received: from saturn.retrosnub.co.uk ([178.18.118.26]:51102 "EHLO saturn.retrosnub.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752462AbbAYXHp (ORCPT ); Sun, 25 Jan 2015 18:07:45 -0500 Message-ID: <54C5773E.2030508@kernel.org> Date: Sun, 25 Jan 2015 23:07:42 +0000 From: Jonathan Cameron User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Irina Tirdea , linux-iio@vger.kernel.org CC: linux-kernel@vger.kernel.org, Vlad Dogaru , Daniel Baluta , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald Subject: Re: [PATCH v2 07/10] iio: core: Introduce IIO_CHAN_INFO_FILTER_OUTLIERS_THRESH and _PERIOD References: <1421003416-27557-1-git-send-email-irina.tirdea@intel.com> <1421003416-27557-8-git-send-email-irina.tirdea@intel.com> In-Reply-To: <1421003416-27557-8-git-send-email-irina.tirdea@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/01/15 19:10, Irina Tirdea wrote: > The pedometer needs to filter out false steps that might be generated by > tapping the foot, sitting, etc. To do that it computes the number of > steps that occur in a given time and decides the user is moving only > if this value is over a threshold. E.g.: the user starts moving only > if he takes 4 steps in 3 seconds. This filter is applied only when > the user starts moving. > > A device that has such pedometer functionality is Freescale's MMA9553L: > http://www.freescale.com/files/sensors/doc/ref_manual/MMA9553LSWRM.pdf. > > To export this feature, this patch introduces > IIO_CHAN_INFO_FILTER_OUTLIERS_THRESH and IIO_CHAN_INFO_FILTER_OUTLIERS_PERIOD. > For the pedometer, in_steps_filter_outlier_thresh will specify the number of > steps that need to occur in in_steps_filter_outlier_period seconds so that > the pedometer decides the user is moving. > > Signed-off-by: Irina Tirdea I wonder if the naming here is infact too generic. They aren't what people would normally think of as outliers. That would be removing missidentified steps mid way through grabbing data (to my mind). These are almost a 'debounce' of the transition from stationary to walking... Maybe there is another better term. All suggestions welcome! > --- > Documentation/ABI/testing/sysfs-bus-iio | 21 +++++++++++++++++++++ > drivers/iio/industrialio-core.c | 2 ++ > include/linux/iio/iio.h | 2 ++ > 3 files changed, 25 insertions(+) > > diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio > index c03a140..e009f49 100644 > --- a/Documentation/ABI/testing/sysfs-bus-iio > +++ b/Documentation/ABI/testing/sysfs-bus-iio > @@ -1193,3 +1193,24 @@ Description: > This attribute is used to read the current speed value of the > user (which is the norm or magnitude of the velocity vector). > Units after application of scale are m/s. > + > +What: /sys/.../iio:deviceX/in_steps_filter_outliers_period > +KernelVersion: 3.20 > +Contact: linux-iio@vger.kernel.org > +Description: > + Specifies the number of seconds in which we compute the > + values so we can decide if they are outlier values and > + need to be filter out. These computed values are then > + compared with in_steps_filter_outliers_thresh. E.g. for steps: > + specifies number of seconds in which we compute the steps > + that occur in order to decide if the consumer is making steps. > + > +What: /sys/.../iio:deviceX/in_steps_filter_outliers_thresh > +KernelVersion: 3.20 > +Contact: linux-iio@vger.kernel.org > +Description: > + Specifies a threshold for filtering outlier values: if value > + measured in in_steps_filter_outliers_period seconds is below > + threshold, we filter it out. E.g. for steps: specifies number > + of steps that must occur within in_steps_filter_outliers_period > + for the pedometer to decide the consumer is making steps. > diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c > index 4ee6fdf..81678b3 100644 > --- a/drivers/iio/industrialio-core.c > +++ b/drivers/iio/industrialio-core.c > @@ -126,6 +126,8 @@ static const char * const iio_chan_info_postfix[] = { > [IIO_CHAN_INFO_ENABLE] = "en", > [IIO_CHAN_INFO_CALIBHEIGHT] = "calibheight", > [IIO_CHAN_INFO_CALIBWEIGHT] = "calibweight", > + [IIO_CHAN_INFO_FILTER_OUTLIERS_THRESH] = "filter_outliers_thresh", > + [IIO_CHAN_INFO_FILTER_OUTLIERS_PERIOD] = "filter_outliers_period", > }; > > /** > diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h > index 752a929..b6b12ac 100644 > --- a/include/linux/iio/iio.h > +++ b/include/linux/iio/iio.h > @@ -41,6 +41,8 @@ enum iio_chan_info_enum { > IIO_CHAN_INFO_ENABLE, > IIO_CHAN_INFO_CALIBHEIGHT, > IIO_CHAN_INFO_CALIBWEIGHT, > + IIO_CHAN_INFO_FILTER_OUTLIERS_THRESH, > + IIO_CHAN_INFO_FILTER_OUTLIERS_PERIOD, > }; > > enum iio_shared_by { >