diff options
-rw-r--r-- | Documentation/ABI/testing/sysfs-bus-iio | 44 | ||||
-rw-r--r-- | drivers/iio/industrialio-core.c | 5 | ||||
-rw-r--r-- | include/linux/iio/types.h | 7 |
3 files changed, 55 insertions, 1 deletions
diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio index 117521dbf2b3..7bf49ad8fd82 100644 --- a/Documentation/ABI/testing/sysfs-bus-iio +++ b/Documentation/ABI/testing/sysfs-bus-iio | |||
@@ -790,6 +790,40 @@ Description: | |||
790 | met before an event is generated. If direction is not | 790 | met before an event is generated. If direction is not |
791 | specified then this period applies to both directions. | 791 | specified then this period applies to both directions. |
792 | 792 | ||
793 | What: /sys/.../events/in_activity_still_thresh_rising_en | ||
794 | What: /sys/.../events/in_activity_still_thresh_falling_en | ||
795 | What: /sys/.../events/in_activity_walking_thresh_rising_en | ||
796 | What: /sys/.../events/in_activity_walking_thresh_falling_en | ||
797 | What: /sys/.../events/in_activity_jogging_thresh_rising_en | ||
798 | What: /sys/.../events/in_activity_jogging_thresh_falling_en | ||
799 | What: /sys/.../events/in_activity_running_thresh_rising_en | ||
800 | What: /sys/.../events/in_activity_running_thresh_falling_en | ||
801 | KernelVersion: 3.19 | ||
802 | Contact: linux-iio@vger.kernel.org | ||
803 | Description: | ||
804 | Enables or disables activitity events. Depending on direction | ||
805 | an event is generated when sensor ENTERS or LEAVES a given state. | ||
806 | |||
807 | What: /sys/.../events/in_activity_still_thresh_rising_value | ||
808 | What: /sys/.../events/in_activity_still_thresh_falling_value | ||
809 | What: /sys/.../events/in_activity_walking_thresh_rising_value | ||
810 | What: /sys/.../events/in_activity_walking_thresh_falling_value | ||
811 | What: /sys/.../events/in_activity_jogging_thresh_rising_value | ||
812 | What: /sys/.../events/in_activity_jogging_thresh_falling_value | ||
813 | What: /sys/.../events/in_activity_running_thresh_rising_value | ||
814 | What: /sys/.../events/in_activity_running_thresh_falling_value | ||
815 | KernelVersion: 3.19 | ||
816 | Contact: linux-iio@vger.kernel.org | ||
817 | Description: | ||
818 | Confidence value (in units as percentage) to be used | ||
819 | for deciding when an event should be generated. E.g for | ||
820 | running: If the confidence value reported by the sensor | ||
821 | is greater than in_activity_running_thresh_rising_value | ||
822 | then the sensor ENTERS running state. Conversely, if the | ||
823 | confidence value reported by the sensor is lower than | ||
824 | in_activity_running_thresh_falling_value then the sensor | ||
825 | is LEAVING running state. | ||
826 | |||
793 | What: /sys/.../iio:deviceX/events/in_accel_mag_en | 827 | What: /sys/.../iio:deviceX/events/in_accel_mag_en |
794 | What: /sys/.../iio:deviceX/events/in_accel_mag_rising_en | 828 | What: /sys/.../iio:deviceX/events/in_accel_mag_rising_en |
795 | What: /sys/.../iio:deviceX/events/in_accel_mag_falling_en | 829 | What: /sys/.../iio:deviceX/events/in_accel_mag_falling_en |
@@ -956,6 +990,16 @@ Description: | |||
956 | and the relevant _type attributes to establish the data storage | 990 | and the relevant _type attributes to establish the data storage |
957 | format. | 991 | format. |
958 | 992 | ||
993 | What: /sys/.../iio:deviceX/in_activity_still_input | ||
994 | What: /sys/.../iio:deviceX/in_activity_walking_input | ||
995 | What: /sys/.../iio:deviceX/in_activity_jogging_input | ||
996 | What: /sys/.../iio:deviceX/in_activity_running_input | ||
997 | KernelVersion: 3.19 | ||
998 | Contact: linux-iio@vger.kernel.org | ||
999 | Description: | ||
1000 | This attribute is used to read the confidence for an activity | ||
1001 | expressed in units as percentage. | ||
1002 | |||
959 | What: /sys/.../iio:deviceX/in_anglvel_z_quadrature_correction_raw | 1003 | What: /sys/.../iio:deviceX/in_anglvel_z_quadrature_correction_raw |
960 | KernelVersion: 2.6.38 | 1004 | KernelVersion: 2.6.38 |
961 | Contact: linux-iio@vger.kernel.org | 1005 | Contact: linux-iio@vger.kernel.org |
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index af3e76d652ba..e453ef9e0c36 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c | |||
@@ -70,6 +70,7 @@ static const char * const iio_chan_type_name_spec[] = { | |||
70 | [IIO_CCT] = "cct", | 70 | [IIO_CCT] = "cct", |
71 | [IIO_PRESSURE] = "pressure", | 71 | [IIO_PRESSURE] = "pressure", |
72 | [IIO_HUMIDITYRELATIVE] = "humidityrelative", | 72 | [IIO_HUMIDITYRELATIVE] = "humidityrelative", |
73 | [IIO_ACTIVITY] = "activity", | ||
73 | }; | 74 | }; |
74 | 75 | ||
75 | static const char * const iio_modifier_names[] = { | 76 | static const char * const iio_modifier_names[] = { |
@@ -91,6 +92,10 @@ static const char * const iio_modifier_names[] = { | |||
91 | [IIO_MOD_NORTH_TRUE] = "from_north_true", | 92 | [IIO_MOD_NORTH_TRUE] = "from_north_true", |
92 | [IIO_MOD_NORTH_MAGN_TILT_COMP] = "from_north_magnetic_tilt_comp", | 93 | [IIO_MOD_NORTH_MAGN_TILT_COMP] = "from_north_magnetic_tilt_comp", |
93 | [IIO_MOD_NORTH_TRUE_TILT_COMP] = "from_north_true_tilt_comp", | 94 | [IIO_MOD_NORTH_TRUE_TILT_COMP] = "from_north_true_tilt_comp", |
95 | [IIO_MOD_RUNNING] = "running", | ||
96 | [IIO_MOD_JOGGING] = "jogging", | ||
97 | [IIO_MOD_WALKING] = "walking", | ||
98 | [IIO_MOD_STILL] = "still", | ||
94 | }; | 99 | }; |
95 | 100 | ||
96 | /* relies on pairs of these shared then separate */ | 101 | /* relies on pairs of these shared then separate */ |
diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h index 4a2af8adf874..b3a241d53b54 100644 --- a/include/linux/iio/types.h +++ b/include/linux/iio/types.h | |||
@@ -30,6 +30,7 @@ enum iio_chan_type { | |||
30 | IIO_CCT, | 30 | IIO_CCT, |
31 | IIO_PRESSURE, | 31 | IIO_PRESSURE, |
32 | IIO_HUMIDITYRELATIVE, | 32 | IIO_HUMIDITYRELATIVE, |
33 | IIO_ACTIVITY, | ||
33 | }; | 34 | }; |
34 | 35 | ||
35 | enum iio_modifier { | 36 | enum iio_modifier { |
@@ -59,7 +60,11 @@ enum iio_modifier { | |||
59 | IIO_MOD_NORTH_MAGN, | 60 | IIO_MOD_NORTH_MAGN, |
60 | IIO_MOD_NORTH_TRUE, | 61 | IIO_MOD_NORTH_TRUE, |
61 | IIO_MOD_NORTH_MAGN_TILT_COMP, | 62 | IIO_MOD_NORTH_MAGN_TILT_COMP, |
62 | IIO_MOD_NORTH_TRUE_TILT_COMP | 63 | IIO_MOD_NORTH_TRUE_TILT_COMP, |
64 | IIO_MOD_RUNNING, | ||
65 | IIO_MOD_JOGGING, | ||
66 | IIO_MOD_WALKING, | ||
67 | IIO_MOD_STILL, | ||
63 | }; | 68 | }; |
64 | 69 | ||
65 | enum iio_event_type { | 70 | enum iio_event_type { |