[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220613120534.36991-2-andrea.merello@iit.it>
Date: Mon, 13 Jun 2022 14:05:21 +0200
From: <andrea.merello@....it>
To: <jic23@...nel.org>, <mchehab+huawei@...nel.org>,
<linux-iio@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<devicetree@...r.kernel.org>
CC: <lars@...afoo.de>, <robh+dt@...nel.org>,
<andy.shevchenko@...il.com>, <matt.ranostay@...sulko.com>,
<ardeleanalex@...il.com>, <jacopo@...ndi.org>,
Andrea Merello <andrea.merello@....it>
Subject: [v6 01/14] iio: add modifiers for linear acceleration
From: Andrea Merello <andrea.merello@....it>
Add IIO_MOD_LINEAR_X, IIO_MOD_LINEAR_Y and IIO_MOD_LINEAR_Z modifiers to te
IIO core, which is preparatory for adding the Bosch BNO055 IMU driver.
Bosch BNO055 IMU can report raw accelerations (among x, y and z axis) as
well as the so called "linear accelerations" (again, among x, y and z axis)
which is basically the acceleration after subtracting gravity and for which
those new modifiers are for.
Signed-off-by: Andrea Merello <andrea.merello@....it>
Reviewed-by: Andy Shevchenko <andy.shevchenko@...il.com>
---
drivers/iio/industrialio-core.c | 3 +++
include/uapi/linux/iio/types.h | 4 +++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index adf054c7a75e..9c0ee7755884 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -134,6 +134,9 @@ static const char * const iio_modifier_names[] = {
[IIO_MOD_ETHANOL] = "ethanol",
[IIO_MOD_H2] = "h2",
[IIO_MOD_O2] = "o2",
+ [IIO_MOD_LINEAR_X] = "linear_x",
+ [IIO_MOD_LINEAR_Y] = "linear_y",
+ [IIO_MOD_LINEAR_Z] = "linear_z",
};
/* 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 472cead10d8d..0993f6b697fc 100644
--- a/include/uapi/linux/iio/types.h
+++ b/include/uapi/linux/iio/types.h
@@ -95,6 +95,9 @@ enum iio_modifier {
IIO_MOD_ETHANOL,
IIO_MOD_H2,
IIO_MOD_O2,
+ IIO_MOD_LINEAR_X,
+ IIO_MOD_LINEAR_Y,
+ IIO_MOD_LINEAR_Z,
};
enum iio_event_type {
@@ -115,4 +118,3 @@ enum iio_event_direction {
};
#endif /* _UAPI_IIO_TYPES_H_ */
-
--
2.17.1
Powered by blists - more mailing lists