iio:event: Add timeout event info type
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 14 Mar 2021 18:14:57 +0000 (18:14 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 7 Apr 2021 07:36:36 +0000 (08:36 +0100)
For adaptive threshold events, the current value is compared with a
(typically) low pass filtered version of the same signal that slowly
tracks large scale changes.  However, sometimes a step change can
result in a large lag before the low pass filtered version begins
to track the signal again.  Timeouts can be used to made an
instantaneous 'correction'.  Documentation of this attribute
is added in a later patch.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20210314181511.531414-11-jic23@kernel.org
drivers/iio/industrialio-event.c
include/linux/iio/types.h

index 1b3a15b..d0732ea 100644 (file)
@@ -245,6 +245,7 @@ static const char * const iio_ev_info_text[] = {
        [IIO_EV_INFO_PERIOD] = "period",
        [IIO_EV_INFO_HIGH_PASS_FILTER_3DB] = "high_pass_filter_3db",
        [IIO_EV_INFO_LOW_PASS_FILTER_3DB] = "low_pass_filter_3db",
+       [IIO_EV_INFO_TIMEOUT] = "timeout",
 };
 
 static enum iio_event_direction iio_ev_attr_dir(struct iio_dev_attr *attr)
index 5aa7f66..84b3f81 100644 (file)
@@ -16,6 +16,7 @@ enum iio_event_info {
        IIO_EV_INFO_PERIOD,
        IIO_EV_INFO_HIGH_PASS_FILTER_3DB,
        IIO_EV_INFO_LOW_PASS_FILTER_3DB,
+       IIO_EV_INFO_TIMEOUT,
 };
 
 #define IIO_VAL_INT 1