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_ANGL channel type

The delta angle is defined as a piece-wise integration of angular
velocity data. The delta angle represents the amount of
angular displacement between two consecutive measurements and it
is measured in radians.

In order to track the total angular displacement during a desired
period of time, simply sum-up the delta angle 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-2-ramona.bolboaca@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Ramona Bolboaca and committed by
Jonathan Cameron
744f4990 8c337436

+26
+22
Documentation/ABI/testing/sysfs-bus-iio
··· 279 279 but should match other such assignments on device). 280 280 Units after application of scale and offset are m/s^2. 281 281 282 + What: /sys/bus/iio/devices/iio:deviceX/in_deltaangl_x_raw 283 + What: /sys/bus/iio/devices/iio:deviceX/in_deltaangl_y_raw 284 + What: /sys/bus/iio/devices/iio:deviceX/in_deltaangl_z_raw 285 + KernelVersion: 6.5 286 + Contact: linux-iio@vger.kernel.org 287 + Description: 288 + Angular displacement between two consecutive samples on x, y or 289 + z (may be arbitrarily assigned but should match other such 290 + assignments on device). 291 + In order to compute the total angular displacement during a 292 + desired period of time, the application should sum-up the delta 293 + angle samples acquired during that time. 294 + Units after application of scale and offset are radians. 295 + 282 296 What: /sys/bus/iio/devices/iio:deviceX/in_angl_raw 283 297 What: /sys/bus/iio/devices/iio:deviceX/in_anglY_raw 284 298 KernelVersion: 4.17 ··· 475 461 What: /sys/bus/iio/devices/iio:deviceX/in_velocity_sqrt(x^2+y^2+z^2)_scale 476 462 What: /sys/bus/iio/devices/iio:deviceX/in_illuminance_scale 477 463 What: /sys/bus/iio/devices/iio:deviceX/in_countY_scale 464 + What: /sys/bus/iio/devices/iio:deviceX/in_deltaangl_scale 478 465 What: /sys/bus/iio/devices/iio:deviceX/in_angl_scale 479 466 What: /sys/bus/iio/devices/iio:deviceX/in_intensity_x_scale 480 467 What: /sys/bus/iio/devices/iio:deviceX/in_intensity_y_scale ··· 1347 1332 What: /sys/.../iio:deviceX/bufferY/in_accel_x_en 1348 1333 What: /sys/.../iio:deviceX/bufferY/in_accel_y_en 1349 1334 What: /sys/.../iio:deviceX/bufferY/in_accel_z_en 1335 + What: /sys/.../iio:deviceX/bufferY/in_deltaangl_x_en 1336 + What: /sys/.../iio:deviceX/bufferY/in_deltaangl_y_en 1337 + What: /sys/.../iio:deviceX/bufferY/in_deltaangl_z_en 1350 1338 What: /sys/.../iio:deviceX/bufferY/in_anglvel_x_en 1351 1339 What: /sys/.../iio:deviceX/bufferY/in_anglvel_y_en 1352 1340 What: /sys/.../iio:deviceX/bufferY/in_anglvel_z_en ··· 1380 1362 Scan element control for triggered data capture. 1381 1363 1382 1364 What: /sys/.../iio:deviceX/bufferY/in_accel_type 1365 + What: /sys/.../iio:deviceX/bufferY/in_deltaangl_type 1383 1366 What: /sys/.../iio:deviceX/bufferY/in_anglvel_type 1384 1367 What: /sys/.../iio:deviceX/bufferY/in_magn_type 1385 1368 What: /sys/.../iio:deviceX/bufferY/in_incli_type ··· 1435 1416 What: /sys/.../iio:deviceX/bufferY/in_accel_x_index 1436 1417 What: /sys/.../iio:deviceX/bufferY/in_accel_y_index 1437 1418 What: /sys/.../iio:deviceX/bufferY/in_accel_z_index 1419 + What: /sys/.../iio:deviceX/bufferY/in_deltaangl_x_index 1420 + What: /sys/.../iio:deviceX/bufferY/in_deltaangl_y_index 1421 + What: /sys/.../iio:deviceX/bufferY/in_deltaangl_z_index 1438 1422 What: /sys/.../iio:deviceX/bufferY/in_anglvel_x_index 1439 1423 What: /sys/.../iio:deviceX/bufferY/in_anglvel_y_index 1440 1424 What: /sys/.../iio:deviceX/bufferY/in_anglvel_z_index
+1
drivers/iio/industrialio-core.c
··· 90 90 [IIO_POSITIONRELATIVE] = "positionrelative", 91 91 [IIO_PHASE] = "phase", 92 92 [IIO_MASSCONCENTRATION] = "massconcentration", 93 + [IIO_DELTA_ANGL] = "deltaangl", 93 94 }; 94 95 95 96 static const char * const iio_modifier_names[] = {
+1
include/uapi/linux/iio/types.h
··· 47 47 IIO_POSITIONRELATIVE, 48 48 IIO_PHASE, 49 49 IIO_MASSCONCENTRATION, 50 + IIO_DELTA_ANGL, 50 51 }; 51 52 52 53 enum iio_modifier {
+2
tools/iio/iio_event_monitor.c
··· 59 59 [IIO_POSITIONRELATIVE] = "positionrelative", 60 60 [IIO_PHASE] = "phase", 61 61 [IIO_MASSCONCENTRATION] = "massconcentration", 62 + [IIO_DELTA_ANGL] = "deltaangl", 62 63 }; 63 64 64 65 static const char * const iio_ev_type_text[] = { ··· 174 173 case IIO_POSITIONRELATIVE: 175 174 case IIO_PHASE: 176 175 case IIO_MASSCONCENTRATION: 176 + case IIO_DELTA_ANGL: 177 177 break; 178 178 default: 179 179 return false;