[PATCH 8/9] iio: Add channel modifiers for Quaternion Rotations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



A quaternion is composed of four components: a vector with x, y, z
coordinates and a w rotation. Added channel modifiers for exporting
these four components via user space.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@xxxxxxxxxxxxxxx>
---
 drivers/iio/industrialio-core.c | 4 ++++
 include/linux/iio/types.h       | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index f95c697..4ffaead 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -80,6 +80,10 @@ static const char * const iio_modifier_names[] = {
 	[IIO_MOD_LIGHT_RED] = "red",
 	[IIO_MOD_LIGHT_GREEN] = "green",
 	[IIO_MOD_LIGHT_BLUE] = "blue",
+	[IIO_MOD_QUATERNION_X] = "quat_x",
+	[IIO_MOD_QUATERNION_Y] = "quat_y",
+	[IIO_MOD_QUATERNION_Z] = "quat_z",
+	[IIO_MOD_QUATERNION_W] = "quat_w",
 };
 
 /* relies on pairs of these shared then separate */
diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h
index 88bf0f0..ac2345c 100644
--- a/include/linux/iio/types.h
+++ b/include/linux/iio/types.h
@@ -52,6 +52,10 @@ enum iio_modifier {
 	IIO_MOD_LIGHT_RED,
 	IIO_MOD_LIGHT_GREEN,
 	IIO_MOD_LIGHT_BLUE,
+	IIO_MOD_QUATERNION_X,
+	IIO_MOD_QUATERNION_Y,
+	IIO_MOD_QUATERNION_Z,
+	IIO_MOD_QUATERNION_W,
 };
 
 #define IIO_VAL_INT 1
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux