lkml.org 
[lkml]   [2021]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[v2 05/10] iio: add modifers for pitch, yaw, roll
Date
This patch adds modifiers for reporting rotations as euler angles (i.e.
yaw, pitch and roll).

Signed-off-by: Andrea Merello <andrea.merello@iit.it>
---
drivers/iio/industrialio-core.c | 5 ++++-
include/uapi/linux/iio/types.h | 3 +++
2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index a79cb32207e4..d2ebbfa8b9fc 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -136,7 +136,10 @@ static const char * const iio_modifier_names[] = {
[IIO_MOD_O2] = "o2",
[IIO_MOD_ACCEL_LINEAR_X] = "linear_x",
[IIO_MOD_ACCEL_LINEAR_Y] = "linear_y",
- [IIO_MOD_ACCEL_LINEAR_Z] = "linear_z"
+ [IIO_MOD_ACCEL_LINEAR_Z] = "linear_z",
+ [IIO_MOD_PITCH] = "pitch",
+ [IIO_MOD_YAW] = "yaw",
+ [IIO_MOD_ROLL] = "roll"
};

/* relies on pairs of these shared then separate */
diff --git a/include/uapi/linux/iio/types.h b/include/uapi/linux/iio/types.h
index db00f7c45f48..fc9909ca4f95 100644
--- a/include/uapi/linux/iio/types.h
+++ b/include/uapi/linux/iio/types.h
@@ -98,6 +98,9 @@ enum iio_modifier {
IIO_MOD_ACCEL_LINEAR_X,
IIO_MOD_ACCEL_LINEAR_Y,
IIO_MOD_ACCEL_LINEAR_Z,
+ IIO_MOD_PITCH,
+ IIO_MOD_YAW,
+ IIO_MOD_ROLL
};

enum iio_event_type {
--
2.17.1
\
 
 \ /
  Last update: 2021-10-28 12:19    [W:0.553 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site