summaryrefslogtreecommitdiffstats
path: root/drivers/iio/industrialio-core.c
diff options
context:
space:
mode:
authorIrina Tirdea <irina.tirdea@intel.com>2015-01-27 19:41:52 +0100
committerJonathan Cameron <jic23@kernel.org>2015-01-29 19:49:57 +0100
commit2f0ecb7c6563d711bec15268d56adf1c630e77d1 (patch)
treee632caab2e65ee84dc93eba696897f75e757c7dd /drivers/iio/industrialio-core.c
parentiio: common: ssp_sensors: Add sensorhub gyroscope sensor (diff)
downloadlinux-2f0ecb7c6563d711bec15268d56adf1c630e77d1.tar.xz
linux-2f0ecb7c6563d711bec15268d56adf1c630e77d1.zip
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>
Diffstat (limited to 'drivers/iio/industrialio-core.c')
-rw-r--r--drivers/iio/industrialio-core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index 4ee6fdfa92fe..aaba9d3d980e 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_DEBOUNCE_COUNT] = "debounce_count",
+ [IIO_CHAN_INFO_DEBOUNCE_TIME] = "debounce_time",
};
/**