iio: core: Introduce IIO_CHAN_INFO_DEBOUNCE_COUNT and _TIME
authorIrina Tirdea <irina.tirdea@intel.com>
Tue, 27 Jan 2015 18:41:52 +0000 (20:41 +0200)
committerJonathan Cameron <jic23@kernel.org>
Thu, 29 Jan 2015 18:49:57 +0000 (18:49 +0000)
commit2f0ecb7c6563d711bec15268d56adf1c630e77d1
treee632caab2e65ee84dc93eba696897f75e757c7dd
parenta9afcaa69fc23679f22cf613e7113a60e115e03a
iio: core: Introduce IIO_CHAN_INFO_DEBOUNCE_COUNT and _TIME

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_DEBOUNCE_COUNT
and IIO_CHAN_INFO_DEBOUNCE_TIME. For the pedometer, in_steps_debounce_count
will specify the number of steps that need to occur in
in_steps_debounce_time seconds so that the pedometer decides the user is
moving.

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Documentation/ABI/testing/sysfs-bus-iio
drivers/iio/industrialio-core.c
include/linux/iio/iio.h