Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: Add IIO_DELTA_VELOCITY channel type

The delta velocity is defined as a piece-wise integration of
acceleration data. The delta velocity represents the linear velocity
change between two consecutive measurements and it
is measured in m / s (meters per second).

In order to track the total linear velocity change during a desired
period of time, simply sum-up the delta velocity samples acquired
during that time.

IIO currently does not offer a suitable channel type for this
type of measurements hence this patch adds it.

Signed-off-by: Ramona Bolboaca <ramona.bolboaca@analog.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20230808075059.645525-3-ramona.bolboaca@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Ramona Bolboaca and committed by
Jonathan Cameron
94a39f2c 744f4990

+27
+23
Documentation/ABI/testing/sysfs-bus-iio
··· 293 293 angle samples acquired during that time. 294 294 Units after application of scale and offset are radians. 295 295 296 + What: /sys/bus/iio/devices/iio:deviceX/in_deltavelocity_x_raw 297 + What: /sys/bus/iio/devices/iio:deviceX/in_deltavelocity_y_raw 298 + What: /sys/bus/iio/devices/iio:deviceX/in_deltavelocity_z_raw 299 + KernelVersion: 6.5 300 + Contact: linux-iio@vger.kernel.org 301 + Description: 302 + The linear velocity change between two consecutive samples on x, 303 + y or z (may be arbitrarily assigned but should match other such 304 + assignments on device). 305 + In order to compute the total linear velocity change during a 306 + desired period of time, the application should sum-up the delta 307 + velocity samples acquired during that time. 308 + Units after application of scale and offset are meters per 309 + second. 310 + 296 311 What: /sys/bus/iio/devices/iio:deviceX/in_angl_raw 297 312 What: /sys/bus/iio/devices/iio:deviceX/in_anglY_raw 298 313 KernelVersion: 4.17 ··· 491 476 What: /sys/bus/iio/devices/iio:deviceX/in_illuminance_scale 492 477 What: /sys/bus/iio/devices/iio:deviceX/in_countY_scale 493 478 What: /sys/bus/iio/devices/iio:deviceX/in_deltaangl_scale 479 + What: /sys/bus/iio/devices/iio:deviceX/in_deltavelocity_scale 494 480 What: /sys/bus/iio/devices/iio:deviceX/in_angl_scale 495 481 What: /sys/bus/iio/devices/iio:deviceX/in_intensity_x_scale 496 482 What: /sys/bus/iio/devices/iio:deviceX/in_intensity_y_scale ··· 1366 1350 What: /sys/.../iio:deviceX/bufferY/in_deltaangl_x_en 1367 1351 What: /sys/.../iio:deviceX/bufferY/in_deltaangl_y_en 1368 1352 What: /sys/.../iio:deviceX/bufferY/in_deltaangl_z_en 1353 + What: /sys/.../iio:deviceX/bufferY/in_deltavelocity_x_en 1354 + What: /sys/.../iio:deviceX/bufferY/in_deltavelocity_y_en 1355 + What: /sys/.../iio:deviceX/bufferY/in_deltavelocity_z_en 1369 1356 What: /sys/.../iio:deviceX/bufferY/in_anglvel_x_en 1370 1357 What: /sys/.../iio:deviceX/bufferY/in_anglvel_y_en 1371 1358 What: /sys/.../iio:deviceX/bufferY/in_anglvel_z_en ··· 1400 1381 1401 1382 What: /sys/.../iio:deviceX/bufferY/in_accel_type 1402 1383 What: /sys/.../iio:deviceX/bufferY/in_deltaangl_type 1384 + What: /sys/.../iio:deviceX/bufferY/in_deltavelocity_type 1403 1385 What: /sys/.../iio:deviceX/bufferY/in_anglvel_type 1404 1386 What: /sys/.../iio:deviceX/bufferY/in_magn_type 1405 1387 What: /sys/.../iio:deviceX/bufferY/in_incli_type ··· 1458 1438 What: /sys/.../iio:deviceX/bufferY/in_deltaangl_x_index 1459 1439 What: /sys/.../iio:deviceX/bufferY/in_deltaangl_y_index 1460 1440 What: /sys/.../iio:deviceX/bufferY/in_deltaangl_z_index 1441 + What: /sys/.../iio:deviceX/bufferY/in_deltavelocity_x_index 1442 + What: /sys/.../iio:deviceX/bufferY/in_deltavelocity_y_index 1443 + What: /sys/.../iio:deviceX/bufferY/in_deltavelocity_z_index 1461 1444 What: /sys/.../iio:deviceX/bufferY/in_anglvel_x_index 1462 1445 What: /sys/.../iio:deviceX/bufferY/in_anglvel_y_index 1463 1446 What: /sys/.../iio:deviceX/bufferY/in_anglvel_z_index
+1
drivers/iio/industrialio-core.c
··· 91 91 [IIO_PHASE] = "phase", 92 92 [IIO_MASSCONCENTRATION] = "massconcentration", 93 93 [IIO_DELTA_ANGL] = "deltaangl", 94 + [IIO_DELTA_VELOCITY] = "deltavelocity", 94 95 }; 95 96 96 97 static const char * const iio_modifier_names[] = {
+1
include/uapi/linux/iio/types.h
··· 48 48 IIO_PHASE, 49 49 IIO_MASSCONCENTRATION, 50 50 IIO_DELTA_ANGL, 51 + IIO_DELTA_VELOCITY, 51 52 }; 52 53 53 54 enum iio_modifier {
+2
tools/iio/iio_event_monitor.c
··· 60 60 [IIO_PHASE] = "phase", 61 61 [IIO_MASSCONCENTRATION] = "massconcentration", 62 62 [IIO_DELTA_ANGL] = "deltaangl", 63 + [IIO_DELTA_VELOCITY] = "deltavelocity", 63 64 }; 64 65 65 66 static const char * const iio_ev_type_text[] = { ··· 176 175 case IIO_PHASE: 177 176 case IIO_MASSCONCENTRATION: 178 177 case IIO_DELTA_ANGL: 178 + case IIO_DELTA_VELOCITY: 179 179 break; 180 180 default: 181 181 return false;