diff options
author | Irina Tirdea <irina.tirdea@intel.com> | 2015-01-11 14:10:08 -0500 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2015-01-27 13:49:53 -0500 |
commit | cc3c9eecaed65b26ee0661e9e9491fd8d48e3907 (patch) | |
tree | 9d1eb51d1b0076e8842eda95c7add4f23de78e7c | |
parent | 72c66644673a61ad85d293de7a61e54b9bdc9682 (diff) |
iio: core: Introduce DISTANCE channel type
Some devices export an estimation of the distance the user has covered
since the last reset.
One of this devices is Freescale's MMA9553L
(http://www.freescale.com/files/sensors/doc/ref_manual/MMA9553LSWRM.pdf)
that computes the distance based on the stride length and step rate.
Introduce a new channel type DISTANCE to export these values.
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r-- | Documentation/ABI/testing/sysfs-bus-iio | 10 | ||||
-rw-r--r-- | drivers/iio/industrialio-core.c | 1 | ||||
-rw-r--r-- | include/linux/iio/types.h | 1 |
3 files changed, 12 insertions, 0 deletions
diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio index 33118862fb8b..c627a9a1cd56 100644 --- a/Documentation/ABI/testing/sysfs-bus-iio +++ b/Documentation/ABI/testing/sysfs-bus-iio | |||
@@ -283,6 +283,7 @@ What: /sys/bus/iio/devices/iio:deviceX/in_accel_scale | |||
283 | What: /sys/bus/iio/devices/iio:deviceX/in_accel_peak_scale | 283 | What: /sys/bus/iio/devices/iio:deviceX/in_accel_peak_scale |
284 | What: /sys/bus/iio/devices/iio:deviceX/in_anglvel_scale | 284 | What: /sys/bus/iio/devices/iio:deviceX/in_anglvel_scale |
285 | What: /sys/bus/iio/devices/iio:deviceX/in_energy_scale | 285 | What: /sys/bus/iio/devices/iio:deviceX/in_energy_scale |
286 | What: /sys/bus/iio/devices/iio:deviceX/in_distance_scale | ||
286 | What: /sys/bus/iio/devices/iio:deviceX/in_magn_scale | 287 | What: /sys/bus/iio/devices/iio:deviceX/in_magn_scale |
287 | What: /sys/bus/iio/devices/iio:deviceX/in_magn_x_scale | 288 | What: /sys/bus/iio/devices/iio:deviceX/in_magn_x_scale |
288 | What: /sys/bus/iio/devices/iio:deviceX/in_magn_y_scale | 289 | What: /sys/bus/iio/devices/iio:deviceX/in_magn_y_scale |
@@ -1059,6 +1060,15 @@ Description: | |||
1059 | device (e.g.: human activity sensors report energy burnt by the | 1060 | device (e.g.: human activity sensors report energy burnt by the |
1060 | user). Units after application of scale are Joules. | 1061 | user). Units after application of scale are Joules. |
1061 | 1062 | ||
1063 | What: /sys/.../iio:deviceX/in_distance_input | ||
1064 | What: /sys/.../iio:deviceX/in_distance_raw | ||
1065 | KernelVersion: 3.20 | ||
1066 | Contact: linux-iio@vger.kernel.org | ||
1067 | Description: | ||
1068 | This attribute is used to read the distance covered by the user | ||
1069 | since the last reboot while activated. Units after application | ||
1070 | of scale are meters. | ||
1071 | |||
1062 | What: /sys/bus/iio/devices/iio:deviceX/store_eeprom | 1072 | What: /sys/bus/iio/devices/iio:deviceX/store_eeprom |
1063 | KernelVersion: 3.4.0 | 1073 | KernelVersion: 3.4.0 |
1064 | Contact: linux-iio@vger.kernel.org | 1074 | Contact: linux-iio@vger.kernel.org |
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index 8d2c9ba85fd7..655755b49ccd 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c | |||
@@ -73,6 +73,7 @@ static const char * const iio_chan_type_name_spec[] = { | |||
73 | [IIO_ACTIVITY] = "activity", | 73 | [IIO_ACTIVITY] = "activity", |
74 | [IIO_STEPS] = "steps", | 74 | [IIO_STEPS] = "steps", |
75 | [IIO_ENERGY] = "energy", | 75 | [IIO_ENERGY] = "energy", |
76 | [IIO_DISTANCE] = "distance", | ||
76 | }; | 77 | }; |
77 | 78 | ||
78 | static const char * const iio_modifier_names[] = { | 79 | static const char * const iio_modifier_names[] = { |
diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h index 26b8a1c5e2af..a7de445222f4 100644 --- a/include/linux/iio/types.h +++ b/include/linux/iio/types.h | |||
@@ -33,6 +33,7 @@ enum iio_chan_type { | |||
33 | IIO_ACTIVITY, | 33 | IIO_ACTIVITY, |
34 | IIO_STEPS, | 34 | IIO_STEPS, |
35 | IIO_ENERGY, | 35 | IIO_ENERGY, |
36 | IIO_DISTANCE, | ||
36 | }; | 37 | }; |
37 | 38 | ||
38 | enum iio_modifier { | 39 | enum iio_modifier { |