iio: core: add high pass filter attributes
authorMartin Fuzzey <mfuzzey@parkeon.com>
Wed, 13 May 2015 10:26:42 +0000 (12:26 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sun, 17 May 2015 09:32:35 +0000 (10:32 +0100)
Add a high pass filter attribute for measurements
(like the existing low pass)

Also add both high and low pass attributes for events.

Signed-off-by: Martin Fuzzey <mfuzzey@parkeon.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Documentation/ABI/testing/sysfs-bus-iio
drivers/iio/industrialio-core.c
drivers/iio/industrialio-event.c
include/linux/iio/iio.h
include/linux/iio/types.h

index e46c71fbd0476bfc5a1d435234415783ad962bc0..f66262c64e2f058e6c1fe490756fae272dea7827 100644 (file)
@@ -420,6 +420,16 @@ Description:
                to the underlying data channel, then this parameter
                gives the 3dB frequency of the filter in Hz.
 
+What:          /sys/.../in_accel_filter_high_pass_3db_frequency
+What:          /sys/.../in_anglvel_filter_high_pass_3db_frequency
+What:          /sys/.../in_magn_filter_high_pass_3db_frequency
+KernelVersion: 4.2
+Contact:       linux-iio@vger.kernel.org
+Description:
+               If a known or controllable high pass filter is applied
+               to the underlying data channel, then this parameter
+               gives the 3dB frequency of the filter in Hz.
+
 What:          /sys/bus/iio/devices/iio:deviceX/out_voltageY_raw
 What:          /sys/bus/iio/devices/iio:deviceX/out_altvoltageY_raw
 KernelVersion: 2.6.37
@@ -880,6 +890,26 @@ Description:
                met before an event is generated. If direction is not
                specified then this period applies to both directions.
 
+What:          /sys/.../events/in_accel_thresh_rising_low_pass_filter_3db
+What:          /sys/.../events/in_anglvel_thresh_rising_low_pass_filter_3db
+What:          /sys/.../events/in_magn_thresh_rising_low_pass_filter_3db
+KernelVersion: 4.2
+Contact:       linux-iio@vger.kernel.org
+Description:
+               If a low pass filter can be applied to the event generation
+               this property gives its 3db frequency in Hz.
+               A value of zero disables the filter.
+
+What:          /sys/.../events/in_accel_thresh_rising_high_pass_filter_3db
+What:          /sys/.../events/in_anglvel_thresh_rising_high_pass_filter_3db
+What:          /sys/.../events/in_magn_thresh_rising_high_pass_filter_3db
+KernelVersion: 4.2
+Contact:       linux-iio@vger.kernel.org
+Description:
+               If a high pass filter can be applied to the event generation
+               this property gives its 3db frequency in Hz.
+               A value of zero disables the filter.
+
 What:          /sys/.../events/in_activity_still_thresh_rising_en
 What:          /sys/.../events/in_activity_still_thresh_falling_en
 What:          /sys/.../events/in_activity_walking_thresh_rising_en
index dfa81db3b910e860c5c8ad0418a0a18657343a06..9688a88b6198ee0a27a8336519ba3a30776e7e8d 100644 (file)
@@ -117,6 +117,8 @@ static const char * const iio_chan_info_postfix[] = {
        [IIO_CHAN_INFO_AVERAGE_RAW] = "mean_raw",
        [IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY]
        = "filter_low_pass_3db_frequency",
+       [IIO_CHAN_INFO_HIGH_PASS_FILTER_3DB_FREQUENCY]
+       = "filter_high_pass_3db_frequency",
        [IIO_CHAN_INFO_SAMP_FREQ] = "sampling_frequency",
        [IIO_CHAN_INFO_FREQUENCY] = "frequency",
        [IIO_CHAN_INFO_PHASE] = "phase",
index a99692ba91bc75fb3186f69f2d55bfc9efd6652c..894d8137c4cfaf7a7b0deddfc407a550045ca3c9 100644 (file)
@@ -211,6 +211,8 @@ static const char * const iio_ev_info_text[] = {
        [IIO_EV_INFO_VALUE] = "value",
        [IIO_EV_INFO_HYSTERESIS] = "hysteresis",
        [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",
 };
 
 static enum iio_event_direction iio_ev_attr_dir(struct iio_dev_attr *attr)
index 058441da4984962b168232eb5974a622b62ccef2..f79148261d16c3ebf7e5e3bf34eb022fb65bb71a 100644 (file)
@@ -32,6 +32,7 @@ enum iio_chan_info_enum {
        IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW,
        IIO_CHAN_INFO_AVERAGE_RAW,
        IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY,
+       IIO_CHAN_INFO_HIGH_PASS_FILTER_3DB_FREQUENCY,
        IIO_CHAN_INFO_SAMP_FREQ,
        IIO_CHAN_INFO_FREQUENCY,
        IIO_CHAN_INFO_PHASE,
index 942b6de68e2f3882ec17fbcebfa1e32e27204b0e..32b579525004492d73ad6a3bd061178abb32aa48 100644 (file)
@@ -17,6 +17,8 @@ enum iio_event_info {
        IIO_EV_INFO_VALUE,
        IIO_EV_INFO_HYSTERESIS,
        IIO_EV_INFO_PERIOD,
+       IIO_EV_INFO_HIGH_PASS_FILTER_3DB,
+       IIO_EV_INFO_LOW_PASS_FILTER_3DB,
 };
 
 #define IIO_VAL_INT 1