iio: introduce mag_referenced
authorCosmin Tanislav <demonsingur@gmail.com>
Mon, 14 Feb 2022 07:38:06 +0000 (09:38 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 21 Feb 2022 19:33:05 +0000 (19:33 +0000)
commita1a5cfe70cd29a59a9a85290dfe95ed1c8df1193
treea30d310aca35538ebd062844006851c7cf48dc3c
parentb38da7feefb4c8080753eb5bf4e4db5eba0e119b
iio: introduce mag_referenced

Some accelerometers that support activity and inactivity
events also support a referenced mode, in which the
gravitational acceleration is taken as a point of
reference before comparing the acceleration to the
specified activity and inactivity magnitude.

For example, in the case of the ADXL367, for activity
detection, the formula is:

abs(acceleration - reference) > magnitude

Add a new event type that makes this behavior clear.

Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Link: https://lore.kernel.org/r/20220214073810.781016-2-cosmin.tanislav@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/industrialio-event.c
include/uapi/linux/iio/types.h
tools/iio/iio_event_monitor.c