Skip to content

Commit cc3c9ee

Browse files
itirdeajic23
authored andcommitted
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>
1 parent 72c6664 commit cc3c9ee

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎Documentation/ABI/testing/sysfs-bus-iio‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ What: /sys/bus/iio/devices/iio:deviceX/in_accel_scale
283283
What: /sys/bus/iio/devices/iio:deviceX/in_accel_peak_scale
284284
What: /sys/bus/iio/devices/iio:deviceX/in_anglvel_scale
285285
What: /sys/bus/iio/devices/iio:deviceX/in_energy_scale
286+
What: /sys/bus/iio/devices/iio:deviceX/in_distance_scale
286287
What: /sys/bus/iio/devices/iio:deviceX/in_magn_scale
287288
What: /sys/bus/iio/devices/iio:deviceX/in_magn_x_scale
288289
What: /sys/bus/iio/devices/iio:deviceX/in_magn_y_scale
@@ -1059,6 +1060,15 @@ Description:
10591060
device (e.g.: human activity sensors report energy burnt by the
10601061
user). Units after application of scale are Joules.
10611062

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+
10621072
What: /sys/bus/iio/devices/iio:deviceX/store_eeprom
10631073
KernelVersion: 3.4.0
10641074
Contact: linux-iio@vger.kernel.org

‎drivers/iio/industrialio-core.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ static const char * const iio_chan_type_name_spec[] = {
7373
[IIO_ACTIVITY] = "activity",
7474
[IIO_STEPS] = "steps",
7575
[IIO_ENERGY] = "energy",
76+
[IIO_DISTANCE] = "distance",
7677
};
7778

7879
static const char * const iio_modifier_names[] = {

‎include/linux/iio/types.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ enum iio_chan_type {
3333
IIO_ACTIVITY,
3434
IIO_STEPS,
3535
IIO_ENERGY,
36+
IIO_DISTANCE,
3637
};
3738

3839
enum iio_modifier {

0 commit comments

Comments
 (0)