Skip to contentSkip to conversation

Add support for Bosch BNO055 IMU

PATCH Superseded [email protected] 6 participants 36 messages Jun 13, 2022 – Jul 13, 2022

Subsystems (3)

v6 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v6 cover Add support for Bosch BNO055 IMU

From: Andrea Merello <[email protected]>

This series (tries to) add support for Bosch BNO055 IMU to Linux IIO subsystem. It is made up several patches:

1/14 to 6/14: add some IIO modifiers, and their documentation, to the IIO
core layer, in order to being able to expose the linear acceleration and Euler angles among standard attributes. Also update the IIO event monitor tool

7/14: fix binary attributes didn't work with IIO

8/14 to 11/14: add the core IIO BNO055 driver and documentation for sysfs
attributes and DT bindings

12/14: adds serdev BNO055 driver to actually use the IMU via serial line

13/14: adds I2C BNO055 driver to actually use the IMU via I2C wiring

14/14: add a documentation file that describe the bno055 driver and
specifically the calibration

Differences wrt v5:
- get rid of few macros
- add almost-empty trace-related file that slipped off prev series
- add newlines to dev_warn() and friends
- some code simplifications
- take advatage of kstrtobool
- style fixes
- comments improvement
- add missing header
- rebase
- fix for some compile errors found by: kernel test robot <[email protected]>

Differences wrt other BNO055 drivers:

Previously at least another driver for the very same chip has been posted to the Linux ML [0], but it has been never merged, and it seems no one cared of it since quite a long time.

This driver differs from the above driver on the following aspects:

- This driver supports also serial access (to be reliable, reset pin is required to be wired)

- The above driver tried to support all IMU HW modes by allowing to choose one in the DT, and adapting IIO attributes accordingly. This driver does not rely on DT for this, instead settings are done via sysfs attributes. All IIO attributes are always exposed; more on this later on. This driver however supports only a subset of the HW-supported modes.

- This driver has some support for managing the IMU calibration

Supported operation modes:

- AMG (accelerometer, magnetometer and gyroscope) mode, which provides raw (uncalibrated) measurements from the said sensors, and allows for setting some parameters about them (e.g. filter cut-off frequency, max sensor ranges, etc).

- Fusion mode, which still provides AMG measures, while it also provides other data calculated by the IMU (e.g. rotation angles, linear acceleration, etc). In this mode user has no freedom to set any sensor parameter, since the HW locks them. Autocalibration and correction is performed by the IMU.

IIO attributes exposing sensors parameters are always present, but in fusion modes the available values are constrained to just the one used by the HW. This is reflected in the '*_available' IIO attributes.

Trying to set a not-supported value always falls back to the closest supported one, which in this case is just the one in use by the HW.

IIO attributes for unavailable measurements (e.g. Euler angles in AMG mode) can't be read (return -EBUSY, or refuse to enable buffer).

IMU calibration:

The IMU supports for two sets of calibration parameters:

- SIC matrix. user-provided; this driver doesn't currently support it

- Offset and radius parameters. The IMU automatically finds out them when it is running in fusion mode; supported by this driver.

The driver provides access to autocalibration flags (i.e. you can known if the IMU has successfully autocalibrated) and to calibration data blob. The user can save this blob in a "firmware" file (i.e. in /lib/firmware) that the driver looks for at probe time. If found, then the IMU is initialized with this calibration data. This saves the user from performing the calibration procedure every time (which consist of moving the IMU in various way).

The driver looks for calibration data file using two different names:
first a file whose name is suffixed with the IMU unique ID is searched for; this is useful when there is more than one IMU instance. If this file is not found, then a "generic" calibration file is searched for (which can be used when only one IMU is present, without struggling with fancy names, that changes on each device).

In AMG mode the IIO 'offset' attributes provide access to the offsets from calibration data (if any), so that the user can apply them to the accel, angvel and magn IIO attributes. In fusion mode they are not needed and read as zero.

Access protocols and serdev module:

The serial protocol is quite simple, but there are tricks to make it really works. Those tricks and workarounds are documented in the driver source file.

The core BNO055 driver tries to group readings in burst when appropriate, in order to optimize triggered buffer operation. The threshold for splitting a burst (i.e. max number of unused bytes in the middle of a burst that will be throw away) is provided to the core driver by the lowlevel access driver (either serdev or I2C) at probe time.

[0] https://www.spinics.net/lists/linux-iio/msg25508.html

Andrea Merello (14):
iio: add modifiers for linear acceleration
iio: document linear acceleration modifiers
iio: event_monitor: add linear acceleration modifiers
iio: add modifers for pitch, yaw, roll
iio: document pitch, yaw, roll modifiers
iio: event_monitor: add pitch, yaw and roll modifiers
iio: add support for binary attributes
iio: imu: add Bosch Sensortec BNO055 core driver
iio: document bno055 private sysfs attributes
iio: document "serialnumber" sysfs attribute
dt-bindings: iio/imu: Add Bosch BNO055
iio: imu: add BNO055 serdev driver
iio: imu: add BNO055 I2C driver
docs: iio: add documentation for BNO055 driver

 Documentation/ABI/testing/sysfs-bus-iio       |   25 +
 .../ABI/testing/sysfs-bus-iio-bno055          |   81 +
 .../bindings/iio/imu/bosch,bno055.yaml        |   59 +
 Documentation/iio/bno055.rst                  |   50 +
 Documentation/iio/index.rst                   |    2 +
 drivers/iio/imu/Kconfig                       |    1 +
 drivers/iio/imu/Makefile                      |    1 +
 drivers/iio/imu/bno055/Kconfig                |   25 +
 drivers/iio/imu/bno055/Makefile               |   10 +
 drivers/iio/imu/bno055/bno055.c               | 1707 +++++++++++++++++
 drivers/iio/imu/bno055/bno055.h               |   13 +
 drivers/iio/imu/bno055/bno055_i2c.c           |   57 +
 drivers/iio/imu/bno055/bno055_ser_core.c      |  560 ++++++
 drivers/iio/imu/bno055/bno055_ser_trace.c     |   13 +
 drivers/iio/imu/bno055/bno055_ser_trace.h     |  104 +
 drivers/iio/industrialio-core.c               |   10 +-
 include/uapi/linux/iio/types.h                |    7 +-
 tools/iio/iio_event_monitor.c                 |    6 +
 18 files changed, 2729 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-bno055
 create mode 100644 Documentation/devicetree/bindings/iio/imu/bosch,bno055.yaml
 create mode 100644 Documentation/iio/bno055.rst
 create mode 100644 drivers/iio/imu/bno055/Kconfig
 create mode 100644 drivers/iio/imu/bno055/Makefile
 create mode 100644 drivers/iio/imu/bno055/bno055.c
 create mode 100644 drivers/iio/imu/bno055/bno055.h
 create mode 100644 drivers/iio/imu/bno055/bno055_i2c.c
 create mode 100644 drivers/iio/imu/bno055/bno055_ser_core.c
 create mode 100644 drivers/iio/imu/bno055/bno055_ser_trace.c
 create mode 100644 drivers/iio/imu/bno055/bno055_ser_trace.h

--
2.17.1

#1 lore raw

PATCH v6 1/14 iio: add modifiers for linear acceleration

From: Andrea Merello <[email protected]>

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.

---
 drivers/iio/industrialio-core.c | 3 +++
 include/uapi/linux/iio/types.h  | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/iio/industrialio-core.c +3 -0
index adf054c7a75e..9c0ee7755884 100644
@@ -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 */
include/uapi/linux/iio/types.h +3 -1
index 472cead10d8d..0993f6b697fc 100644
@@ -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_ */
-
Signature · 1 line
2.17.1
#2 lore raw

PATCH v6 2/14 iio: document linear acceleration modifiers

In reply to [email protected]

From: Andrea Merello <[email protected]>

Introduce ABI documentation for new IIO modifiers used for reporting "linear acceleration" measures.

---
 Documentation/ABI/testing/sysfs-bus-iio | 9 +++++++++
 1 file changed, 9 insertions(+)
Documentation/ABI/testing/sysfs-bus-iio +9 -0
index 3e00d7f7ee22..88d012bbfe79 100644
@@ -238,6 +238,15 @@ Description:
 		Has all of the equivalent parameters as per voltageY. Units
 		after application of scale and offset are m/s^2.
 
+What:		/sys/bus/iio/devices/iio:deviceX/in_accel_linear_x_raw
+What:		/sys/bus/iio/devices/iio:deviceX/in_accel_linear_y_raw
+What:		/sys/bus/iio/devices/iio:deviceX/in_accel_linear_z_raw
+KernelVersion:	5.20
+Contact:	[email protected]
+Description:
+		As per in_accel_X_raw attributes, but minus the
+		acceleration due to gravity.
+
 What:		/sys/bus/iio/devices/iio:deviceX/in_gravity_x_raw
 What:		/sys/bus/iio/devices/iio:deviceX/in_gravity_y_raw
 What:		/sys/bus/iio/devices/iio:deviceX/in_gravity_z_raw
Signature · 1 line
2.17.1
#3 lore raw

PATCH v6 3/14 iio: event_monitor: add linear acceleration modifiers

In reply to [email protected]

From: Andrea Merello <[email protected]>

Following the introduction of IIO linear acceleration modifiers, update the event_monitor tool accordingly.

---
 tools/iio/iio_event_monitor.c | 3 +++
 1 file changed, 3 insertions(+)
tools/iio/iio_event_monitor.c +3 -0
index 2f4581658859..1fee44abb836 100644
@@ -122,6 +122,9 @@ static const char * const iio_modifier_names[] = {
 	[IIO_MOD_PM4] = "pm4",
 	[IIO_MOD_PM10] = "pm10",
 	[IIO_MOD_O2] = "o2",
+	[IIO_MOD_LINEAR_X] = "linear_x",
+	[IIO_MOD_LINEAR_Y] = "linear_y",
+	[IIO_MOD_LINEAR_Z] = "linear_z",
 };
 
 static bool event_is_known(struct iio_event_data *event)
Signature · 1 line
2.17.1
#4 lore raw

PATCH v6 4/14 iio: add modifers for pitch, yaw, roll

In reply to [email protected]

From: Andrea Merello <[email protected]>

Add modifiers for reporting rotations as euler angles (i.e. yaw, pitch and roll).

---
 drivers/iio/industrialio-core.c | 3 +++
 include/uapi/linux/iio/types.h  | 3 +++
 2 files changed, 6 insertions(+)
drivers/iio/industrialio-core.c +3 -0
index 9c0ee7755884..4d95d4df5e91 100644
@@ -137,6 +137,9 @@ static const char * const iio_modifier_names[] = {
 	[IIO_MOD_LINEAR_X] = "linear_x",
 	[IIO_MOD_LINEAR_Y] = "linear_y",
 	[IIO_MOD_LINEAR_Z] = "linear_z",
+	[IIO_MOD_PITCH] = "pitch",
+	[IIO_MOD_YAW] = "yaw",
+	[IIO_MOD_ROLL] = "roll",
 };
 
 /* relies on pairs of these shared then separate */
include/uapi/linux/iio/types.h +3 -0
index 0993f6b697fc..4853701ba70d 100644
@@ -98,6 +98,9 @@ enum iio_modifier {
 	IIO_MOD_LINEAR_X,
 	IIO_MOD_LINEAR_Y,
 	IIO_MOD_LINEAR_Z,
+	IIO_MOD_PITCH,
+	IIO_MOD_YAW,
+	IIO_MOD_ROLL,
 };
 
 enum iio_event_type {
Signature · 1 line
2.17.1
#5 lore raw

PATCH v6 5/14 iio: document pitch, yaw, roll modifiers

In reply to [email protected]

From: Andrea Merello <[email protected]>

Introduce ABI documentation for new modifiers used for reporting rotations expressed as euler angles (i.e. yaw, pitch, roll).

It looks like we have some unit inconsistency along various IIO modifiers:
it seems that incli is in deg, angl is in radians and rot isn't documented, but at least the adis16209 driver has rot in deg.

Here we use deg (so angl is the only one using radians).

---
 Documentation/ABI/testing/sysfs-bus-iio | 9 +++++++++
 1 file changed, 9 insertions(+)
Documentation/ABI/testing/sysfs-bus-iio +9 -0
index 88d012bbfe79..2f54f26d9e59 100644
@@ -2044,3 +2044,12 @@ Description:
 		Available range for the forced calibration value, expressed as:
 
 		- a range specified as "[min step max]"
+
+What:		/sys/bus/iio/devices/iio:deviceX/in_rot_yaw_raw
+What:		/sys/bus/iio/devices/iio:deviceX/in_rot_pitch_raw
+What:		/sys/bus/iio/devices/iio:deviceX/in_rot_roll_raw
+KernelVersion:	5.20
+Contact:	[email protected]
+Description:
+		Raw (unscaled) euler angles readings. Units after
+		application of scale are deg.
Signature · 1 line
2.17.1
#6 lore raw

PATCH v6 6/14 iio: event_monitor: add pitch, yaw and roll modifiers

In reply to [email protected]

From: Andrea Merello <[email protected]>

Following the introduction of pitch, yaw and roll IIO modifiers, update the event_monitor tool accordingly.

---
 tools/iio/iio_event_monitor.c | 3 +++
 1 file changed, 3 insertions(+)
tools/iio/iio_event_monitor.c +3 -0
index 1fee44abb836..ee3f78c47655 100644
@@ -125,6 +125,9 @@ static const char * const iio_modifier_names[] = {
 	[IIO_MOD_LINEAR_X] = "linear_x",
 	[IIO_MOD_LINEAR_Y] = "linear_y",
 	[IIO_MOD_LINEAR_Z] = "linear_z",
+	[IIO_MOD_PITCH] = "pitch",
+	[IIO_MOD_YAW] = "yaw",
+	[IIO_MOD_ROLL] = "roll",
 };
 
 static bool event_is_known(struct iio_event_data *event)
Signature · 1 line
2.17.1
#7 lore raw

PATCH v6 7/14 iio: add support for binary attributes

In reply to [email protected]

From: Andrea Merello <[email protected]>

When a IIO device is registered, the IIO core creates an attribute group on its own, where it puts the channel attributes, and where it copies the attributes in indio_dev->info->attrs.

Unfortunately it doesn't take care of binary attributes (i.e. it only consider indio_dev->info->attrs->attrs, and it ignores indio_dev->info->attrs->bin_attrs).

Fix this by making the IIO layer take care also of the binary attributes.

Note that while it is necessary to copy the non-binary attributes because the IIO layer needs more room to add the channels attribute, it should be enough to assign the bin_attrs pointer to the binary attributes pointed by indio_dev->info->attrs->bin_attrs.

---
 drivers/iio/industrialio-core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/iio/industrialio-core.c +3 -1
index 4d95d4df5e91..2ea5e19ea56a 100644
@@ -1581,7 +1581,7 @@ static int iio_device_register_sysfs(struct iio_dev *indio_dev)
 		ret = -ENOMEM;
 		goto error_clear_attrs;
 	}
-	/* Copy across original attributes */
+	/* Copy across original attributes, and point to original binary attributes */
 	if (indio_dev->info->attrs) {
 		memcpy(iio_dev_opaque->chan_attr_group.attrs,
 		       indio_dev->info->attrs->attrs,
@@ -1589,6 +1589,8 @@ static int iio_device_register_sysfs(struct iio_dev *indio_dev)
 		       *attrcount_orig);
 		iio_dev_opaque->chan_attr_group.is_visible =
 			indio_dev->info->attrs->is_visible;
+		iio_dev_opaque->chan_attr_group.bin_attrs =
+			indio_dev->info->attrs->bin_attrs;
 	}
 	attrn = attrcount_orig;
 	/* Add all elements from the list. */
Signature · 1 line
2.17.1
#8 lore raw

PATCH v6 8/14 iio: imu: add Bosch Sensortec BNO055 core driver

In reply to [email protected]

From: Andrea Merello <[email protected]>

Add the core driver for the BNO055 IMU from Bosch. This IMU can be connected via both serial and I2C busses; separate patches will add support for them.

The driver supports "AMG" (Accelerometer, Magnetometer, Gyroscope) mode, that provides raw data from the said internal sensors, and a couple of "fusion" modes (i.e. the IMU also does calculations in order to provide euler angles, quaternions, linear acceleration and gravity measurements).

In fusion modes the AMG data is still available (with some calibration refinements done by the IMU), but certain settings such as low pass filters cut-off frequency and sensors' ranges are fixed, while in AMG mode they can be customized; this is why AMG mode can still be interesting.

---
 drivers/iio/imu/Kconfig         |    1 +
 drivers/iio/imu/Makefile        |    1 +
 drivers/iio/imu/bno055/Kconfig  |    4 +
 drivers/iio/imu/bno055/Makefile |    3 +
 drivers/iio/imu/bno055/bno055.c | 1712 +++++++++++++++++++++++++++++++
 drivers/iio/imu/bno055/bno055.h |   13 +
 6 files changed, 1734 insertions(+)
 create mode 100644 drivers/iio/imu/bno055/Kconfig
 create mode 100644 drivers/iio/imu/bno055/Makefile
 create mode 100644 drivers/iio/imu/bno055/bno055.c
 create mode 100644 drivers/iio/imu/bno055/bno055.h
drivers/iio/imu/Kconfig +1 -0
index 001ca2c3ff95..f1d7d4b5e222 100644
@@ -52,6 +52,7 @@ config ADIS16480
 	  ADIS16485, ADIS16488 inertial sensors.
 
 source "drivers/iio/imu/bmi160/Kconfig"
+source "drivers/iio/imu/bno055/Kconfig"
 
 config FXOS8700
 	tristate
drivers/iio/imu/Makefile +1 -0
index c82748096c77..6eb612034722 100644
@@ -15,6 +15,7 @@ adis_lib-$(CONFIG_IIO_ADIS_LIB_BUFFER) += adis_buffer.o
 obj-$(CONFIG_IIO_ADIS_LIB) += adis_lib.o
 
 obj-y += bmi160/
+obj-y += bno055/
 
 obj-$(CONFIG_FXOS8700) += fxos8700_core.o
 obj-$(CONFIG_FXOS8700_I2C) += fxos8700_i2c.o
drivers/iio/imu/bno055/Kconfig new file +4 -0
new file mode 100644
index 000000000000..d0ab3221fba5
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
+
+config BOSCH_BNO055_IIO
+	tristate
drivers/iio/imu/bno055/Makefile new file +3 -0
new file mode 100644
index 000000000000..56cc4de60a7e
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0
+
+obj-$(CONFIG_BOSCH_BNO055_IIO) += bno055.o
drivers/iio/imu/bno055/bno055.c new file +1712 -0

1,712 lines not on this page · raw message

drivers/iio/imu/bno055/bno055.h new file +13 -0
new file mode 100644
index 000000000000..64f9fc95cebc
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#ifndef __BNO055_H__
+#define __BNO055_H__
+
+#include <linux/regmap.h>
+#include <linux/types.h>
+
+struct device;
+int bno055_probe(struct device *dev, struct regmap *regmap,
+		 int xfer_burst_break_thr, bool sw_reset);
+extern const struct regmap_config bno055_regmap_config;
+
+#endif
Signature · 1 line
2.17.1
#9 lore raw

Re: [v6 08/14] iio: imu: add Bosch Sensortec BNO055 core driver

Quoted 16 lines · On Mon, Jun 13, 2022 at 2:05 PM <[email protected]> wrote:

From: Andrea Merello <[email protected]>

Add the core driver for the BNO055 IMU from Bosch. This IMU can be connected via both serial and I2C busses; separate patches will add support for them.

The driver supports "AMG" (Accelerometer, Magnetometer, Gyroscope) mode, that provides raw data from the said internal sensors, and a couple of "fusion" modes (i.e. the IMU also does calculations in order to provide euler angles, quaternions, linear acceleration and gravity measurements).

In fusion modes the AMG data is still available (with some calibration refinements done by the IMU), but certain settings such as low pass filters cut-off frequency and sensors' ranges are fixed, while in AMG mode they can be customized; this is why AMG mode can still be interesting.

...

Quoted 1 line

+config BOSCH_BNO055_IIO

Does it need _IIO suffix? Any name collision?

...

drivers/iio/imu/bno055/bno055.c line 127

Quoted 3 lines
drivers/iio/imu/bno055/bno055.c new file +3 -0
+static int bno055_acc_lpf_vals[] = {
+       7, 810000, 15, 630000, 31, 250000, 62, 500000,
+       125, 0, 250, 0, 500, 0, 1000, 0

+ Comma?

Quoted 1 line

+};

...

Quoted 1 line

+ /* G: 2, 4, 8, 16 */

Indentation of this comment is a bit off.

Quoted 1 line

+static int bno055_acc_range_vals[] = {1962, 3924, 7848, 15696};

Perhaps split this to 4 lines and put the comment on top of the third line?

...

drivers/iio/imu/bno055/bno055.c line 169

Quoted 3 lines
drivers/iio/imu/bno055/bno055.c new file +3 -0
+static int bno055_gyr_scale_vals[] = {
+       125, 1877467, 250, 1877467, 500, 1877467,
+       1000, 1877467, 2000, 1877467

+ Comma?

Quoted 1 line

+};

...

Quoted 3 lines
drivers/iio/imu/bno055/bno055.c new file +3 -0
+#ifdef CONFIG_DEBUG_FS
+       struct dentry *debugfs;
+#endif

...

drivers/iio/imu/bno055/bno055.c line 684

Quoted 2 lines
drivers/iio/imu/bno055/bno055.c new file +2 -0
+                       /*
+                        * IMU reports sensor offests; IIO wants correction

offsets

Quoted 2 lines
(quoted diff) +2 -0
+                        * offsets, thus we need the 'minus' here.
+                        */

...

Review

Quoted 2 lines
(quoted diff) +2 -0
+       if (kstrtobool(buf, &en))
+               return -EINVAL;

Why shadow an actual error code(s)?

...

drivers/iio/imu/bno055/bno055.c line 1148

Quoted 3 lines
drivers/iio/imu/bno055/bno055.c new file +3 -0
+       ret = kstrtoul(buf, 10, &val);
+       if (ret)
+               return ret;

Here it's done properly (see just above).

...

drivers/iio/imu/bno055/bno055.c line 1318

Quoted 9 lines
drivers/iio/imu/bno055/bno055.c new file +8 -0
+static void bno055_debugfs_init(struct iio_dev *iio_dev)
+{
+       struct bno055_priv *priv = iio_priv(iio_dev);
+
+       priv->debugfs = debugfs_create_file("firmware_version", 0400,
+                                           iio_get_debugfs_dentry(iio_dev),
+                                           priv, &bno055_fw_version_ops);
 
+       devm_add_action_or_reset(priv->dev, bno055_debugfs_remove, priv->debugfs);

Shouldn't we report the potential error here? It's not directly related to debugfs, but something which is not directly related.

Quoted 1 line

+}

...

drivers/iio/imu/bno055/bno055.c line 1334

Quoted 3 lines
drivers/iio/imu/bno055/bno055.c new file +3 -0
+static IIO_DEVICE_ATTR(fusion_enable, 0644,
+                      bno055_fusion_enable_show,
+                      bno055_fusion_enable_store, 0);

IIO_DEVICE_ATTR_RW()

drivers/iio/imu/bno055/bno055.c line 1342

Quoted 7 lines
drivers/iio/imu/bno055/bno055.c new file +7 -0
+static IIO_DEVICE_ATTR(in_magn_calibration_fast_enable, 0644,
+                      bno055_fmc_enable_show,
+                      bno055_fmc_enable_store, 0);
+
+static IIO_DEVICE_ATTR(in_accel_range_raw, 0644,
+                      bno055_in_accel_range_show,
+                      bno055_in_accel_range_store, 0);

Ditto for above.

...

Review

Quoted 2 lines
(quoted diff) +2 -0
+       /*
+        * All chans are made up 1 16-bit sample, except for quaternion that is

channels

Quoted 6 lines
drivers/iio/imu/bno055/bno055.c new file +6 -0
+        * made up 4 16-bit values.
+        * For us the quaternion CH is just like 4 regular CHs.
+        * If our read starts past the quaternion make sure to adjust the
+        * starting offset; if the quaternion is contained in our scan then make
+        * sure to adjust the read len.
+        */
Signature · 2 lines
With Best Regards,
Andy Shevchenko
#10 lore raw

Re: [v6 08/14] iio: imu: add Bosch Sensortec BNO055 core driver

Few inline comments, OK for the rest.

Quoted 9 lines

...

Quoted 1 line

+ /* G: 2, 4, 8, 16 */

Indentation of this comment is a bit off.

Quoted 1 line

+static int bno055_acc_range_vals[] = {1962, 3924, 7848, 15696};

Perhaps split this to 4 lines and put the comment on top of the third line?

Not sure what you mean here, sorry. May you elaborate or provide an example, please?

Quoted 10 lines

...

Quoted 7 lines
drivers/iio/imu/bno055/bno055.c new file +7 -0
+static void bno055_debugfs_init(struct iio_dev *iio_dev)
+{
+       struct bno055_priv *priv = iio_priv(iio_dev);
+
+       priv->debugfs = debugfs_create_file("firmware_version", 0400,
+                                           iio_get_debugfs_dentry(iio_dev),
+                                           priv, &bno055_fw_version_ops);
Quoted 4 lines
Quoted 1 line

+ devm_add_action_or_reset(priv->dev, bno055_debugfs_remove, priv->debugfs);

Shouldn't we report the potential error here? It's not directly related to debugfs, but something which is not directly related.

The error eventually comes out from something that has nothing to do with debugs per se (i.e. the devm stuff), but it will only affect debugfs indeed.

Assuming that we don't want to make the whole driver fail in case debugfs stuff fails (see last part of the comment above debugfs_create_file() implementation), and given that the devm_add_action_or_reset(), should indeed "reset" in case of failure (i.e. we should be in a clean situation anyway), I would say it should be OK not to propagate the error and let things go on.

However we can add a dev_warn() to report what happened.

#11 lore raw

Re: [v6 08/14] iio: imu: add Bosch Sensortec BNO055 core driver

On Tue, Jun 14, 2022 at 11:11 AM Andrea Merello <[email protected]> wrote:

...

Quoted 9 lines
Quoted 7 lines
Quoted 1 line

+ /* G: 2, 4, 8, 16 */

Indentation of this comment is a bit off.

Quoted 1 line

+static int bno055_acc_range_vals[] = {1962, 3924, 7848, 15696};

Perhaps split this to 4 lines and put the comment on top of the third line?

Not sure what you mean here, sorry. May you elaborate or provide an example, please?

static int ... [] = {
    /* Comment goes here */

value1, value2, ..., valueN,
};

...

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
drivers/iio/imu/bno055/bno055.c new file +7 -0
+static void bno055_debugfs_init(struct iio_dev *iio_dev)
+{
+       struct bno055_priv *priv = iio_priv(iio_dev);
+
+       priv->debugfs = debugfs_create_file("firmware_version", 0400,
+                                           iio_get_debugfs_dentry(iio_dev),
+                                           priv, &bno055_fw_version_ops);
Quoted 8 lines
Quoted 4 lines
Quoted 1 line

+ devm_add_action_or_reset(priv->dev, bno055_debugfs_remove, priv->debugfs);

Shouldn't we report the potential error here? It's not directly related to debugfs, but something which is not directly related.

The error eventually comes out from something that has nothing to do with debugs per se (i.e. the devm stuff), but it will only affect debugfs indeed.

Assuming that we don't want to make the whole driver fail in case debugfs stuff fails (see last part of the comment above debugfs_create_file() implementation), and given that the devm_add_action_or_reset(), should indeed "reset" in case of failure (i.e. we should be in a clean situation anyway), I would say it should be OK not to propagate the error and let things go on.

As I said, it's not directly related to debugfs. Here is the resource leak possible or bad things happen if you probe the driver, that fails to add this call for removal, remove it, and try to insert again, in such case the debugfs will be stale.

Quoted 1 line

However we can add a dev_warn() to report what happened.

Not sure if it would suffice, I leave it to Jonathan.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#12 lore raw

Re: [v6 08/14] iio: imu: add Bosch Sensortec BNO055 core driver

Quoted 17 lines

...

Quoted 13 lines
Quoted 12 lines

drivers/iio/imu/bno055/bno055.c line 1318

Quoted 9 lines
drivers/iio/imu/bno055/bno055.c new file +8 -0
+static void bno055_debugfs_init(struct iio_dev *iio_dev)
+{
+       struct bno055_priv *priv = iio_priv(iio_dev);
+
+       priv->debugfs = debugfs_create_file("firmware_version", 0400,
+                                           iio_get_debugfs_dentry(iio_dev),
+                                           priv, &bno055_fw_version_ops);
 
+       devm_add_action_or_reset(priv->dev, bno055_debugfs_remove, priv->debugfs);

Shouldn't we report the potential error here? It's not directly related to debugfs, but something which is not directly related.

Quoted 8 lines
Quoted 3 lines

The error eventually comes out from something that has nothing to do with debugs per se (i.e. the devm stuff), but it will only affect debugfs indeed.

Assuming that we don't want to make the whole driver fail in case debugfs stuff fails (see last part of the comment above debugfs_create_file() implementation), and given that the devm_add_action_or_reset(), should indeed "reset" in case of failure (i.e. we should be in a clean situation anyway), I would say it should be OK not to propagate the error and let things go on.

As I said, it's not directly related to debugfs. Here is the resource leak possible or bad things happen if you probe the driver, that fails to add this call for removal, remove it, and try to insert again, in such case the debugfs will be stale.

Hum, I would say this shouldn't ever happen: AFAICS devm_add_action_or_reset() is a wrapper around devm_add_action() and it's purpose is exactly to add a check for failure; devm_add_action_or_reset() immediately invokes the action handler in case devm_add_action() fails. IOW in case of failure to add the devm stuff, the debugfs file is removed immediately and it shouldn't cause any mess with next times probe()s; just the driver will go on without the debugfs file being here.

I think this is the point of using devm_add_action_or_reset() instead of dev_add_action() indeed, or am I missing something?

Quoted 7 lines
Quoted 1 line

However we can add a dev_warn() to report what happened.

Not sure if it would suffice, I leave it to Jonathan.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#13 lore raw

Re: [v6 08/14] iio: imu: add Bosch Sensortec BNO055 core driver

On Tue, Jun 14, 2022 at 2:15 PM Andrea Merello <[email protected]> wrote:

...

Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
Quoted 4 lines
Quoted 1 line

+ devm_add_action_or_reset(priv->dev, bno055_debugfs_remove, priv->debugfs);

Shouldn't we report the potential error here? It's not directly related to debugfs, but something which is not directly related.

The error eventually comes out from something that has nothing to do with debugs per se (i.e. the devm stuff), but it will only affect debugfs indeed.

Assuming that we don't want to make the whole driver fail in case debugfs stuff fails (see last part of the comment above debugfs_create_file() implementation), and given that the devm_add_action_or_reset(), should indeed "reset" in case of failure (i.e. we should be in a clean situation anyway), I would say it should be OK not to propagate the error and let things go on.

Quoted 8 lines
Quoted 4 lines

As I said, it's not directly related to debugfs. Here is the resource leak possible or bad things happen if you probe the driver, that fails to add this call for removal, remove it, and try to insert again, in such case the debugfs will be stale.

Hum, I would say this shouldn't ever happen: AFAICS devm_add_action_or_reset() is a wrapper around devm_add_action() and it's purpose is exactly to add a check for failure; devm_add_action_or_reset() immediately invokes the action handler in case devm_add_action() fails. IOW in case of failure to add the devm stuff, the debugfs file is removed immediately and it shouldn't cause any mess with next times probe()s; just the driver will go on without the debugfs file being here.

I think this is the point of using devm_add_action_or_reset() instead of dev_add_action() indeed, or am I missing something?

Reading that code again and I think you are right, so dev_warn() will be sufficient to show that we fail. OTOH, what is the point of adding a resource for the failed debugfs call?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#14 lore raw

Re: [v6 08/14] iio: imu: add Bosch Sensortec BNO055 core driver

Il giorno mar 14 giu 2022 alle ore 17:11 Andy Shevchenko <[email protected]> ha scritto:

Quoted 19 lines · Andrea Merello

...

Quoted 14 lines
Quoted 13 lines
Quoted 8 lines
Quoted 4 lines
Quoted 1 line

+ devm_add_action_or_reset(priv->dev, bno055_debugfs_remove, priv->debugfs);

Shouldn't we report the potential error here? It's not directly related to debugfs, but something which is not directly related.

The error eventually comes out from something that has nothing to do with debugs per se (i.e. the devm stuff), but it will only affect debugfs indeed.

Assuming that we don't want to make the whole driver fail in case debugfs stuff fails (see last part of the comment above debugfs_create_file() implementation), and given that the devm_add_action_or_reset(), should indeed "reset" in case of failure (i.e. we should be in a clean situation anyway), I would say it should be OK not to propagate the error and let things go on.

As I said, it's not directly related to debugfs. Here is the resource leak possible or bad things happen if you probe the driver, that fails to add this call for removal, remove it, and try to insert again, in such case the debugfs will be stale.

Quoted 7 lines
Quoted 3 lines

Hum, I would say this shouldn't ever happen: AFAICS devm_add_action_or_reset() is a wrapper around devm_add_action() and it's purpose is exactly to add a check for failure; devm_add_action_or_reset() immediately invokes the action handler in case devm_add_action() fails. IOW in case of failure to add the devm stuff, the debugfs file is removed immediately and it shouldn't cause any mess with next times probe()s; just the driver will go on without the debugfs file being here.

I think this is the point of using devm_add_action_or_reset() instead of dev_add_action() indeed, or am I missing something?

Reading that code again and I think you are right, so dev_warn() will be sufficient to show that we fail. OTOH, what is the point of adding a resource for the failed debugfs call?

Ah, you are right here: I'll make the call to devm_add_action_or_reset() conditional to success of debugfs_create_file(). In case any of the two fails we can also warn the user.

Quoted 3 lines

--
With Best Regards,
Andy Shevchenko

maintainer
#15 lore raw

Re: [v6 08/14] iio: imu: add Bosch Sensortec BNO055 core driver

In reply to [email protected]
Quoted 11 lines · On Mon, 13 Jun 2022 14:05:28 +0200 <[email protected]> wrote:

From: Andrea Merello <[email protected]>

Add the core driver for the BNO055 IMU from Bosch. This IMU can be connected via both serial and I2C busses; separate patches will add support for them.

The driver supports "AMG" (Accelerometer, Magnetometer, Gyroscope) mode, that provides raw data from the said internal sensors, and a couple of "fusion" modes (i.e. the IMU also does calculations in order to provide euler angles, quaternions, linear acceleration and gravity measurements).

Quoted 7 lines

In fusion modes the AMG data is still available (with some calibration refinements done by the IMU), but certain settings such as low pass filters cut-off frequency and sensors' ranges are fixed, while in AMG mode they can be customized; this is why AMG mode can still be interesting.

---

Hi Andrea,

A few trivial things from me this time seeing as you are going to be doing a v7.

Thanks,

Jonathan

Quoted 11 lines
drivers/iio/imu/bno055/bno055.c new file +11 -0
+
+static ssize_t bno055_get_calib_status(struct device *dev, char *buf, int which)
+{
+	struct bno055_priv *priv = iio_priv(dev_to_iio_dev(dev));
+	int calib;
+	int ret;
+	int val;
+
+	if (priv->operation_mode == BNO055_OPR_MODE_AMG ||
+	    (priv->operation_mode == BNO055_OPR_MODE_FUSION_FMC_OFF &&
+	     which == BNO055_CALIB_STAT_MAGN_SHIFT)) {

drivers/iio/imu/bno055/bno055.c line 1179

Quoted 10 lines
drivers/iio/imu/bno055/bno055.c new file +10 -0
+		calib = 0;
+	} else {
+		mutex_lock(&priv->lock);
+		ret = regmap_read(priv->regmap, BNO055_CALIB_STAT_REG, &val);
+		mutex_unlock(&priv->lock);
+
+		if (ret)
+			return -EIO;
+
+		calib = ((val >> which) & BNO055_CALIB_STAT_MASK) + 1;

Hmm. This is an unsual field get. I wonder if it is good idea to have what looks like a field mask in BNO055_CALIB_STAT_MASK but isn't really because we are applying it to a shifted value. Maybe we are better off just encoding it directly here as GENMASK(1, 0)

drivers/iio/imu/bno055/bno055.c

Quoted 7 lines
drivers/iio/imu/bno055/bno055.c new file +6 -0
+	}
+
+	return sysfs_emit(buf, "%d\n", calib);
+}
+
 
+#ifdef CONFIG_DEBUG_FS

I'm not particularly keen on ifdef fun in c files. How bad is it if we just don't bother and use __maybe_unused. debug_fs_createfile is visible to the compiler in !CONFIG_DEBUG_FS so it should manage to remove everything except *_debugfs_reg_access() but that is trivial in size anyway.

Quoted 71 lines
drivers/iio/imu/bno055/bno055.c new file +71 -0
+static int bno055_debugfs_reg_access(struct iio_dev *iio_dev, unsigned int reg,
+				     unsigned int writeval, unsigned int *readval)
+{
+	struct bno055_priv *priv = iio_priv(iio_dev);
+
+	if (readval)
+		return regmap_read(priv->regmap, reg, readval);
+	else
+		return regmap_write(priv->regmap, reg, writeval);
+}
+
+static ssize_t bno055_show_fw_version(struct file *file, char __user *userbuf,
+				      size_t count, loff_t *ppos)
+{
+	struct bno055_priv *priv = file->private_data;
+	int rev, ver;
+	char *buf;
+	int ret;
+
+	ret = regmap_read(priv->regmap, BNO055_SW_REV_LSB_REG, &rev);
+	if (ret)
+		return ret;
+
+	ret = regmap_read(priv->regmap, BNO055_SW_REV_MSB_REG, &ver);
+	if (ret)
+		return ret;
+
+	buf = kasprintf(GFP_KERNEL, "ver: 0x%x, rev: 0x%x\n", ver, rev);
+	if (!buf)
+		return -ENOMEM;
+
+	ret = simple_read_from_buffer(userbuf, count, ppos, buf, strlen(buf));
+	kfree(buf);
+
+	return ret;
+}
+
+static const struct file_operations bno055_fw_version_ops = {
+	.open = simple_open,
+	.read = bno055_show_fw_version,
+	.llseek = default_llseek,
+	.owner = THIS_MODULE,
+};
+
+static void bno055_debugfs_remove(void *debugfs)
+{
+	debugfs_remove((struct dentry *)debugfs);
+}
+
+static void bno055_debugfs_init(struct iio_dev *iio_dev)
+{
+	struct bno055_priv *priv = iio_priv(iio_dev);
+
+	priv->debugfs = debugfs_create_file("firmware_version", 0400,
+					    iio_get_debugfs_dentry(iio_dev),
+					    priv, &bno055_fw_version_ops);
+
+	devm_add_action_or_reset(priv->dev, bno055_debugfs_remove, priv->debugfs);
+}
+#else
+static void bno055_debugfs_init(struct iio_dev *iio_dev)
+{
+}
+
+static int bno055_debugfs_reg_access(struct iio_dev *iio_dev, unsigned int reg,
+				     unsigned int writeval, unsigned int *readval)
+{
+	return 0;
+}
+#endif
+

...

Quoted 35 lines
drivers/iio/imu/bno055/bno055.c new file +35 -0
+
+static irqreturn_t bno055_trigger_handler(int irq, void *p)
+{
+	struct iio_poll_func *pf = p;
+	struct iio_dev *iio_dev = pf->indio_dev;
+	struct bno055_priv *priv = iio_priv(iio_dev);
+	int xfer_start, start, end, prev_end;
+	unsigned long mask;
+	int quat_extra_len;
+	bool first = true;
+	int buf_idx = 0;
+	bool thr_hit;
+	int ret;
+
+	mutex_lock(&priv->lock);
+
+	/*
+	 * Walk the bitmap and eventually perform several transfers.
+	 * Bitmap ones-fields that are separated by gaps <= xfer_burst_break_thr
+	 * will be included in same transfer.
+	 * Every time the bitmap contains a gap wider than xfer_burst_break_thr
+	 * then we split the transfer, skipping the gap.
+	 */
+	for_each_set_bitrange(start, end, iio_dev->active_scan_mask,
+			      iio_dev->masklength) {
+		/*
+		 * First transfer will start from the beginning of the first
+		 * ones-field in the bitmap
+		 */
+		if (first) {
+			xfer_start = start;
+		} else {
+			/*
+			 * We found the next ones-field; check whether to
+			 * include it in * the current transfer or not (i.e.

drivers/iio/imu/bno055/bno055.c line 1496

Quoted 10 lines
drivers/iio/imu/bno055/bno055.c new file +10 -0
+			 * let's perform the current * transfer and prepare for
+			 * another one).
+			 */
+
+			/*
+			 * In case the zeros-gap contains the quaternion bit,
+			 * then its length is actually 4 words instead of 1
+			 * (i.e. +3 wrt other channels).
+			 */
+			quat_extra_len = ((start > BNO055_SCAN_QUATERNION) &&

you could reduce the scope of quat_extra_len and thr_hit, perhaps
to just within the for loop. Perhaps it's not worth bothering though. Up to you.

Quoted 23 lines
drivers/iio/imu/bno055/bno055.c new file +23 -0
+					  (prev_end <= BNO055_SCAN_QUATERNION)) ? 3 : 0;
+
+			/* If the gap is wider than xfer_burst_break_thr then.. */
+			thr_hit = (start - prev_end + quat_extra_len) >
+				priv->xfer_burst_break_thr;
+
+			/*
+			 * .. transfer all the data up to the gap. Then set the
+			 * next transfer start index at right after the gap
+			 * (i.e. at the start of this ones-field).
+			 */
+			if (thr_hit) {
+				mask = *iio_dev->active_scan_mask >> xfer_start;
+				ret = bno055_scan_xfer(priv, xfer_start,
+						       prev_end - xfer_start,
+						       mask, priv->buf.chans, &buf_idx);
+				if (ret)
+					goto done;
+				xfer_start = start;
+			}
+		}
+		first = false;
+		prev_end = end;

drivers/iio/imu/bno055/bno055.c line 1529

Quoted 10 lines
drivers/iio/imu/bno055/bno055.c new file +10 -0
+	}
+
+	/*
+	 * We finished walking the bitmap; no more gaps to check for. Just
+	 * perform the current transfer.
+	 */
+	mask = *iio_dev->active_scan_mask >> xfer_start;
+	ret = bno055_scan_xfer(priv, xfer_start,
+			       prev_end - xfer_start,
+			       mask, priv->buf.chans, &buf_idx);

Check ret and if it's an error don't push the data.

Quoted 12 lines
drivers/iio/imu/bno055/bno055.c new file +11 -0
+
+	iio_push_to_buffers_with_timestamp(iio_dev, &priv->buf, pf->timestamp);
+done:
+	mutex_unlock(&priv->lock);
+	iio_trigger_notify_done(iio_dev->trig);
+	return IRQ_HANDLED;
+}
+
 
+int bno055_probe(struct device *dev, struct regmap *regmap,
+		 int xfer_burst_break_thr, bool sw_reset)
+{

...

Quoted 9 lines
drivers/iio/imu/bno055/bno055.c new file +9 -0
+
+	/*
+	 * The stock FW version contains a bug (see comment at the beginning of
+	 * this file) that causes the anglvel scale to be changed depending on
+	 * the chip range setting. We workaround this, but we don't know what
+	 * other FW versions might do.
+	 */
+	if (ver != 0x3 || rev != 0x11)
+		dev_warn(dev, "Untested firmware version. Anglvel scale may not work as expected\n");

drivers/iio/imu/bno055/bno055.c line 1661

Quoted 10 lines
drivers/iio/imu/bno055/bno055.c new file +10 -0
+
+	ret = regmap_bulk_read(priv->regmap, BNO055_UID_LOWER_REG,
+			       priv->uid, BNO055_UID_LEN);
+	if (ret)
+		return ret;
+
+	/* Sensor calibration data */
+	fw_name_buf = kasprintf(GFP_KERNEL,
+				BNO055_FW_UID_FMT,
+				BNO055_UID_LEN, priv->uid);

No need to break this into so many lines. Can get it on two without passing 80 chars.

#16 lore raw

PATCH v6 9/14 iio: document bno055 private sysfs attributes

In reply to [email protected]

From: Andrea Merello <[email protected]>

Add ABI documentation for bno055 driver private sysfs attributes.

---
 .../ABI/testing/sysfs-bus-iio-bno055          | 81 +++++++++++++++++++
 1 file changed, 81 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-bno055
Documentation/ABI/testing/sysfs-bus-iio-bno055 new file +81 -0
new file mode 100644
index 000000000000..8d3d0a79d7e4
@@ -0,0 +1,81 @@
+What:		/sys/bus/iio/devices/iio:deviceX/in_accel_raw_range
+KernelVersion:	5.20
+Contact:	[email protected]
+Description:
+		Raw (unscaled) range for acceleration readings. Unit after
+		application of scale is m/s^2. Note that this doesn't affects
+		the scale (which should be used when changing the maximum and
+		minimum readable value affects also the reading scaling factor).
+
+What:		/sys/bus/iio/devices/iio:deviceX/in_anglvel_raw_range
+KernelVersion:	5.20
+Contact:	[email protected]
+Description:
+		Range for angular velocity readings in radians per second. Note
+		that this does not affects the scale (which should be used when
+		changing the maximum and minimum readable value affects also the
+		reading scaling factor).
+
+What:		/sys/bus/iio/devices/iio:deviceX/in_accel_raw_range_available
+KernelVersion:	5.20
+Contact:	[email protected]
+Description:
+		List of allowed values for in_accel_raw_range attribute
+
+What:		/sys/bus/iio/devices/iio:deviceX/in_anglvel_raw_range_available
+KernelVersion:	5.20
+Contact:	[email protected]
+Description:
+		List of allowed values for in_anglvel_raw_range attribute
+
+What:		/sys/bus/iio/devices/iio:deviceX/in_magn_calibration_fast_enable
+KernelVersion:	5.20
+Contact:	[email protected]
+Description:
+		Can be 1 or 0. Enables/disables the "Fast Magnetometer
+		Calibration" HW function.
+
+What:		/sys/bus/iio/devices/iio:deviceX/fusion_enable
+KernelVersion:	5.20
+Contact:	[email protected]
+Description:
+		Can be 1 or 0. Enables/disables the "sensor fusion" (a.k.a.
+		NDOF) HW function.
+
+What:		/sys/bus/iio/devices/iio:deviceX/calibration_data
+KernelVersion:	5.20
+Contact:	[email protected]
+Description:
+		Reports the binary calibration data blob for the IMU sensors.
+
+What:		/sys/bus/iio/devices/iio:deviceX/in_accel_calibration_auto_status
+KernelVersion:	5.20
+Contact:	[email protected]
+Description:
+		Reports the autocalibration status for the accelerometer sensor.
+		Can be 0 (calibration non even enabled) or 1 to 5 where the greater
+		the number, the better the calibration status.
+
+What:		/sys/bus/iio/devices/iio:deviceX/in_gyro_calibration_auto_status
+KernelVersion:	5.20
+Contact:	[email protected]
+Description:
+		Reports the autocalibration status for the gyroscope sensor.
+		Can be 0 (calibration non even enabled) or 1 to 5 where the greater
+		the number, the better the calibration status.
+
+What:		/sys/bus/iio/devices/iio:deviceX/in_magn_calibration_auto_status
+KernelVersion:	5.20
+Contact:	[email protected]
+Description:
+		Reports the autocalibration status for the magnetometer sensor.
+		Can be 0 (calibration non even enabled) or 1 to 5 where the greater
+		the number, the better the calibration status.
+
+What:		/sys/bus/iio/devices/iio:deviceX/sys_calibration_auto_status
+KernelVersion:	5.20
+Contact:	[email protected]
+Description:
+		Reports the status for the IMU overall autocalibration.
+		Can be 0 (calibration non even enabled) or 1 to 5 where the greater
+		the number, the better the calibration status.
Signature · 1 line
2.17.1
#17 lore raw

PATCH v6 10/14 iio: document "serialnumber" sysfs attribute

In reply to [email protected]

From: Andrea Merello <[email protected]>

Add ABI documentation for the new "serialnumber" sysfs attribute. The first user is the bno055 IIO driver.

---
 Documentation/ABI/testing/sysfs-bus-iio | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/ABI/testing/sysfs-bus-iio +7 -0
index 2f54f26d9e59..03e29517c1a4 100644
@@ -2053,3 +2053,10 @@ Contact:	[email protected]
 Description:
 		Raw (unscaled) euler angles readings. Units after
 		application of scale are deg.
+
+What:		/sys/bus/iio/devices/iio:deviceX/serialnumber
+KernelVersion:	5.20
+Contact:	[email protected]
+Description:
+		An example format is 16-bytes, 2-digits-per-byte, HEX-string
+		representing the sensor unique ID number.
Signature · 1 line
2.17.1
#18 lore raw

PATCH v6 11/14 dt-bindings: iio/imu: Add Bosch BNO055

In reply to [email protected]

From: Andrea Merello <[email protected]>

Introduce new documentation file for the Bosch BNO055 IMU.

---
 .../bindings/iio/imu/bosch,bno055.yaml        | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/imu/bosch,bno055.yaml
Documentation/devicetree/bindings/iio/imu/bosch,bno055.yaml new file +59 -0
new file mode 100644
index 000000000000..e0d06db161a9
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/imu/bosch,bno055.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Bosch BNO055
+
+maintainers:
+  - Andrea Merello <[email protected]>
+
+description: |
+  Inertial Measurement Unit with Accelerometer, Gyroscope, Magnetometer and
+  internal MCU for sensor fusion
+  https://www.bosch-sensortec.com/products/smart-sensors/bno055/
+
+properties:
+  compatible:
+    enum:
+      - bosch,bno055
+
+  reg:
+    maxItems: 1
+
+  reset-gpios:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+required:
+  - compatible
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    serial {
+      imu {
+        compatible = "bosch,bno055";
+        reset-gpios = <&gpio0 54 GPIO_ACTIVE_LOW>;
+        clocks = <&imu_clk>;
+      };
+    };
+
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      imu@28 {
+        compatible = "bosch,bno055";
+        reg = <0x28>;
+        reset-gpios = <&gpio0 54 GPIO_ACTIVE_LOW>;
+        clocks = <&imu_clk>;
+      };
+    };
Signature · 1 line
2.17.1
#19 lore raw

PATCH v6 12/14 iio: imu: add BNO055 serdev driver

In reply to [email protected]

From: Andrea Merello <[email protected]>

Add a serdev driver for communicating to a BNO055 IMU via serial bus, and enable the BNO055 core driver to work in this scenario.

---
 drivers/iio/imu/bno055/Kconfig            |  10 +
 drivers/iio/imu/bno055/Makefile           |   5 +
 drivers/iio/imu/bno055/bno055_ser_core.c  | 560 ++++++++++++++++++++++
 drivers/iio/imu/bno055/bno055_ser_trace.c |  13 +
 drivers/iio/imu/bno055/bno055_ser_trace.h | 104 ++++
 5 files changed, 692 insertions(+)
 create mode 100644 drivers/iio/imu/bno055/bno055_ser_core.c
 create mode 100644 drivers/iio/imu/bno055/bno055_ser_trace.c
 create mode 100644 drivers/iio/imu/bno055/bno055_ser_trace.h
drivers/iio/imu/bno055/Kconfig +10 -0
index d0ab3221fba5..d014b68cd43d 100644
@@ -2,3 +2,13 @@
 
 config BOSCH_BNO055_IIO
 	tristate
+
+config BOSCH_BNO055_SERIAL
+	tristate "Bosch BNO055 attached via UART"
+	depends on SERIAL_DEV_BUS
+	select BOSCH_BNO055_IIO
+	help
+	  Enable this to support Bosch BNO055 IMUs attached via UART.
+
+	  This driver can also be built as a module. If so, the module will be
+	  called bno055_sl.
drivers/iio/imu/bno055/Makefile +5 -0
index 56cc4de60a7e..212307ce9c08 100644
@@ -1,3 +1,8 @@
 # SPDX-License-Identifier: GPL-2.0
 
 obj-$(CONFIG_BOSCH_BNO055_IIO) += bno055.o
+obj-$(CONFIG_BOSCH_BNO055_SERIAL) += bno055_ser.o
+bno055_ser-y := bno055_ser_core.o
+# define_trace.h needs to know how to find our header
+CFLAGS_bno055_ser_trace.o := -I$(src)
+bno055_ser-$(CONFIG_TRACING) += bno055_ser_trace.o
drivers/iio/imu/bno055/bno055_ser_core.c new file +560 -0

560 lines not on this page · raw message

drivers/iio/imu/bno055/bno055_ser_trace.c new file +13 -0
new file mode 100644
index 000000000000..9e5c65c70fd8
@@ -0,0 +1,13 @@
+//SPDX-License-Identifier: GPL-2.0
+/*
+ * bno055_ser Trace Support
+ * Copyright (C) 2022 Istituto Italiano di Tecnologia
+ * Electronic Design Laboratory
+ *
+ * Based on:
+ *   Device core Trace Support
+ *   Copyright (C) 2021, Intel Corporation
+ */
+
+#define CREATE_TRACE_POINTS
+#include "bno055_ser_trace.h"
drivers/iio/imu/bno055/bno055_ser_trace.h new file +104 -0

104 lines not on this page · raw message

Signature · 1 line
2.17.1
#20 lore raw

Re: [v6 12/14] iio: imu: add BNO055 serdev driver

Quoted 5 lines · On Mon, Jun 13, 2022 at 2:05 PM <[email protected]> wrote:

From: Andrea Merello <[email protected]>

Add a serdev driver for communicating to a BNO055 IMU via serial bus, and enable the BNO055 core driver to work in this scenario.

...

Quoted 1 line

+ * This driver is besed on

based

Quoted 3 lines
+ *     Plantower PMS7003 particulate matter sensor driver
+ *     Which is
+ *     Copyright (c) Tomasz Duszynski <[email protected]>

...

Quoted 5 lines

+/*
+ * Read operation overhead:

+ *  4 bytes req + 2byte resp hdr.
+ *  6 bytes = 60 bit (considering 1start + 1stop bits).
+ *  60/115200 = ~520uS + about 2500mS dealay -> ~3mS

delay

Quoted 2 lines

+ * In 3mS we could read back about 34 bytes that means 17 samples, this means
+ * that in case of scattered read in which the gap is 17 samples or less it is

reads

Quoted 6 lines

+ * still convenient to go for a burst.
+ * We have to take into account also IMU response time - IMU seems to be often
+ * reasonably quick to respond, but sometimes it seems to be in some "critical
+ * section" in which it delays handling of serial protocol. Because of this we
+ * round-up to 22, which is the max number of samples, always bursting indeed.
+ */

...

Quoted 2 lines

+/*
+ * Sends a read or write command.

Send

...

Quoted 2 lines

+/*
+ * Handler for received data; this is called from the reicever callback whenever

receiver

Quoted 1 line

+ * it got some packet from the serial bus. The status tell us whether the

tells

Quoted 2 lines

+ * packet is valid (i.e. header ok && received payload len consistent wrt the
+ * header). It's now our responsability to check whether this is what we

responsibility

Quoted 2 lines

+ * expected, of whether we got some unexpected, yet valid, packet.
+ */

...

drivers/iio/imu/bno055/bno055_ser_core.c line 396

Quoted 3 lines
drivers/iio/imu/bno055/bno055_ser_core.c new file +3 -0
+               /*
+                * New packet.
+                * Check for its 1st byte, that identifies the pkt type.

byte that

Quoted 1 line

+ */

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#21 lore raw

Re: [v6 12/14] iio: imu: add BNO055 serdev driver

In reply to [email protected]
Thank you for the patch! Perhaps something to improve:

Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on jic23-iio/togreg]
[also build test WARNING on linus/master v5.19-rc2 next-20220615] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/intel-lab-lkp/linux/commits/andrea-merello-iit-it/Add-support-for-Bosch-BNO055-IMU/20220614-203754
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
config: sparc-allyesconfig (https://download.01.org/0day-ci/archive/20220616/[email protected]/config)
compiler: sparc64-linux-gcc (GCC) 11.3.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/f37504a206ca4b342e184a1fc137f6c47f3960e9
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review andrea-merello-iit-it/Add-support-for-Bosch-BNO055-IMU/20220614-203754
git checkout f37504a206ca4b342e184a1fc137f6c47f3960e9
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=sparc SHELL=/bin/bash drivers/gpu/ drivers/iio/

If you fix the issue, kindly add following tag where applicable

All warnings (new ones prefixed by >>):

In file included from include/trace/define_trace.h:102,

                    from drivers/iio/imu/bno055/bno055_ser_trace.h:104,
                    from drivers/iio/imu/bno055/bno055_ser_trace.c:13:
   drivers/iio/imu/bno055/./bno055_ser_trace.h: In function 'trace_raw_output_recv':
>> drivers/iio/imu/bno055/./bno055_ser_trace.h:91:23: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' {aka 'long unsigned int'} [-Wformat=]
      91 |             TP_printk("len: %d, data: = %*ph",
         |                       ^~~~~~~~~~~~~~~~~~~~~~~
   include/trace/trace_events.h:203:34: note: in definition of macro 'DECLARE_EVENT_CLASS'
     203 |         trace_event_printf(iter, print);                                \
         |                                  ^~~~~
   include/trace/trace_events.h:45:30: note: in expansion of macro 'PARAMS'
      45 |                              PARAMS(print));                   \
         |                              ^~~~~~
   drivers/iio/imu/bno055/./bno055_ser_trace.h:79:1: note: in expansion of macro 'TRACE_EVENT'
      79 | TRACE_EVENT(recv,
         | ^~~~~~~~~~~
   drivers/iio/imu/bno055/./bno055_ser_trace.h:91:13: note: in expansion of macro 'TP_printk'
      91 |             TP_printk("len: %d, data: = %*ph",
         |             ^~~~~~~~~
   In file included from include/trace/trace_events.h:237,
                    from include/trace/define_trace.h:102,
                    from drivers/iio/imu/bno055/bno055_ser_trace.h:104,
                    from drivers/iio/imu/bno055/bno055_ser_trace.c:13:
   drivers/iio/imu/bno055/./bno055_ser_trace.h:91:30: note: format string is defined here
      91 |             TP_printk("len: %d, data: = %*ph",
         |                             ~^
         |                              |
         |                              int
         |                             %ld
   In file included from include/trace/define_trace.h:102,
                    from drivers/iio/imu/bno055/bno055_ser_trace.h:104,
                    from drivers/iio/imu/bno055/bno055_ser_trace.c:13:
>> drivers/iio/imu/bno055/./bno055_ser_trace.h:91:23: warning: field width specifier '*' expects argument of type 'int', but argument 4 has type 'size_t' {aka 'long unsigned int'} [-Wformat=]
      91 |             TP_printk("len: %d, data: = %*ph",
         |                       ^~~~~~~~~~~~~~~~~~~~~~~
   include/trace/trace_events.h:203:34: note: in definition of macro 'DECLARE_EVENT_CLASS'
     203 |         trace_event_printf(iter, print);                                \
         |                                  ^~~~~
   include/trace/trace_events.h:45:30: note: in expansion of macro 'PARAMS'
      45 |                              PARAMS(print));                   \
         |                              ^~~~~~
   drivers/iio/imu/bno055/./bno055_ser_trace.h:79:1: note: in expansion of macro 'TRACE_EVENT'
      79 | TRACE_EVENT(recv,
         | ^~~~~~~~~~~
   drivers/iio/imu/bno055/./bno055_ser_trace.h:91:13: note: in expansion of macro 'TP_printk'
      91 |             TP_printk("len: %d, data: = %*ph",
         |             ^~~~~~~~~
   In file included from include/trace/trace_events.h:237,
                    from include/trace/define_trace.h:102,
                    from drivers/iio/imu/bno055/bno055_ser_trace.h:104,
                    from drivers/iio/imu/bno055/bno055_ser_trace.c:13:
   drivers/iio/imu/bno055/./bno055_ser_trace.h:91:42: note: format string is defined here
      91 |             TP_printk("len: %d, data: = %*ph",
         |                                         ~^~
         |                                          |
         |                                          int

vim +91 drivers/iio/imu/bno055/./bno055_ser_trace.h

    78	
    79	TRACE_EVENT(recv,
    80		    TP_PROTO(size_t len, const unsigned char *buf),
    81		    TP_ARGS(len, buf),
    82		    TP_STRUCT__entry(
    83			    __field(size_t, len)
    84			    __dynamic_array(unsigned char, buf, len)
    85		    ),
    86		    TP_fast_assign(
    87			    __entry->len = len;
    88			    memcpy(__get_dynamic_array(buf),
    89				   buf, __entry->len);
    90		    ),
  > 91		    TP_printk("len: %d, data: = %*ph",
    92			      __entry->len, __entry->len, __get_dynamic_array(buf)
    93		    )
    94	);
    95	
Signature · 2 lines
0-DAY CI Kernel Test Service
https://01.org/lkp
#22 lore raw

Re: [v6 12/14] iio: imu: add BNO055 serdev driver

On Wed, Jun 15, 2022 at 10:57 PM kernel test robot <[email protected]> wrote:

...

Quoted 14 lines
Quoted 1 line
Quoted 1 line

drivers/iio/imu/bno055/./bno055_ser_trace.h:91:23: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' {aka 'long unsigned int'} [-Wformat=]

    80              TP_PROTO(size_t len, const unsigned char *buf),
    81              TP_ARGS(len, buf),
    82              TP_STRUCT__entry(
    83                      __field(size_t, len)
    84                      __dynamic_array(unsigned char, buf, len)
    85              ),
    86              TP_fast_assign(
    87                      __entry->len = len;
    88                      memcpy(__get_dynamic_array(buf),
    89                             buf, __entry->len);
    90              ),
Quoted 1 line

91 TP_printk("len: %d, data: = %*ph",

Obviously it must be %zu

Quoted 2 lines
    92                        __entry->len, __entry->len, __get_dynamic_array(buf)
    93              )
Signature · 2 lines
With Best Regards,
Andy Shevchenko
#23 lore raw

Re: [v6 12/14] iio: imu: add BNO055 serdev driver

Quoted 19 lines · Andy Shevchenko

On Wed, Jun 15, 2022 at 10:57 PM kernel test robot <[email protected]> wrote:

...

Quoted 14 lines
Quoted 1 line
Quoted 1 line

drivers/iio/imu/bno055/./bno055_ser_trace.h:91:23: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' {aka 'long unsigned int'} [-Wformat=]

    80              TP_PROTO(size_t len, const unsigned char *buf),
    81              TP_ARGS(len, buf),
    82              TP_STRUCT__entry(
    83                      __field(size_t, len)
    84                      __dynamic_array(unsigned char, buf, len)
    85              ),
    86              TP_fast_assign(
    87                      __entry->len = len;
    88                      memcpy(__get_dynamic_array(buf),
    89                             buf, __entry->len);
    90              ),
Quoted 1 line

91 TP_printk("len: %d, data: = %*ph",

Quoted 3 lines

Obviously it must be %zu

Quoted 1 line
    92                        __entry->len, __entry->len, __get_dynamic_array(buf)

...and the second len here should be casted to (int) explicitly, since
* in the printf() format specifier means int argument.

Quoted 1 line
Quoted 1 line

93 )

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#24 lore raw

Re: [v6 12/14] iio: imu: add BNO055 serdev driver

In reply to [email protected]
Thank you for the patch! Perhaps something to improve:

Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on jic23-iio/togreg]
[also build test WARNING on linus/master v5.19-rc4 next-20220701] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/intel-lab-lkp/linux/commits/andrea-merello-iit-it/Add-support-for-Bosch-BNO055-IMU/20220614-203754
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20220703/[email protected]/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project bcd153485ebf07fe79e2b843ed5f1cb74997df1b)

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/f37504a206ca4b342e184a1fc137f6c47f3960e9
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review andrea-merello-iit-it/Add-support-for-Bosch-BNO055-IMU/20220614-203754 git checkout f37504a206ca4b342e184a1fc137f6c47f3960e9
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/iio/

If you fix the issue, kindly add following tag where applicable

All warnings (new ones prefixed by >>):

In file included from drivers/iio/imu/bno055/bno055_ser_trace.c:13:
In file included from drivers/iio/imu/bno055/./bno055_ser_trace.h:104:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:237:

>> drivers/iio/imu/bno055/./bno055_ser_trace.h:92:9: warning: format specifies type 'int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
                         __entry->len, __entry->len, __get_dynamic_array(buf)
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/trace/stages/stage3_trace_output.h:6:17: note: expanded from macro '__entry'
   #define __entry field
                   ^
   include/trace/stages/stage3_trace_output.h:9:43: note: expanded from macro 'TP_printk'
   #define TP_printk(fmt, args...) fmt "\n", args
                                   ~~~       ^
   include/trace/trace_events.h:45:16: note: expanded from macro 'TRACE_EVENT'
                                PARAMS(print));                   \
                                ~~~~~~~^~~~~~~
   include/linux/tracepoint.h:107:25: note: expanded from macro 'PARAMS'
   #define PARAMS(args...) args
                           ^~~~
   include/trace/trace_events.h:203:27: note: expanded from macro 'DECLARE_EVENT_CLASS'
           trace_event_printf(iter, print);                                \
                                    ^~~~~
   In file included from drivers/iio/imu/bno055/bno055_ser_trace.c:13:
   In file included from drivers/iio/imu/bno055/./bno055_ser_trace.h:104:
   In file included from include/trace/define_trace.h:102:
   In file included from include/trace/trace_events.h:237:
>> drivers/iio/imu/bno055/./bno055_ser_trace.h:91:36: warning: field width should have type 'int', but argument has type 'size_t' (aka 'unsigned long') [-Wformat]
               TP_printk("len: %d, data: = %*ph",
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
   include/trace/stages/stage3_trace_output.h:9:33: note: expanded from macro 'TP_printk'
   #define TP_printk(fmt, args...) fmt "\n", args
                                   ^~~
   include/trace/trace_events.h:45:16: note: expanded from macro 'TRACE_EVENT'
                                PARAMS(print));                   \
                                ~~~~~~~^~~~~~~
   include/linux/tracepoint.h:107:25: note: expanded from macro 'PARAMS'
   #define PARAMS(args...) args
                           ^~~~
   include/trace/trace_events.h:203:27: note: expanded from macro 'DECLARE_EVENT_CLASS'
           trace_event_printf(iter, print);                                \
                                    ^~~~~

2 warnings generated.

vim +92 drivers/iio/imu/bno055/./bno055_ser_trace.h

    78	
    79	TRACE_EVENT(recv,
    80		    TP_PROTO(size_t len, const unsigned char *buf),
    81		    TP_ARGS(len, buf),
    82		    TP_STRUCT__entry(
    83			    __field(size_t, len)
    84			    __dynamic_array(unsigned char, buf, len)
    85		    ),
    86		    TP_fast_assign(
    87			    __entry->len = len;
    88			    memcpy(__get_dynamic_array(buf),
    89				   buf, __entry->len);
    90		    ),
  > 91		    TP_printk("len: %d, data: = %*ph",
  > 92			      __entry->len, __entry->len, __get_dynamic_array(buf)
    93		    )
    94	);
    95	
Signature · 2 lines
0-DAY CI Kernel Test Service
https://01.org/lkp
#25 lore raw

PATCH v6 13/14 iio: imu: add BNO055 I2C driver

In reply to [email protected]

From: Andrea Merello <[email protected]>

Add an I2C driver for communicating to a BNO055 IMU via I2C bus and enable the BNO055 core driver to work in this scenario.

---
 drivers/iio/imu/bno055/Kconfig      | 11 ++++++
 drivers/iio/imu/bno055/Makefile     |  2 +
 drivers/iio/imu/bno055/bno055_i2c.c | 57 +++++++++++++++++++++++++++++
 3 files changed, 70 insertions(+)
 create mode 100644 drivers/iio/imu/bno055/bno055_i2c.c
drivers/iio/imu/bno055/Kconfig +11 -0
index d014b68cd43d..ccf9ea7c50f8 100644
@@ -12,3 +12,14 @@ config BOSCH_BNO055_SERIAL
 
 	  This driver can also be built as a module. If so, the module will be
 	  called bno055_sl.
+
+config BOSCH_BNO055_I2C
+	tristate "Bosch BNO055 attached via I2C bus"
+	depends on I2C
+	select REGMAP_I2C
+	select BOSCH_BNO055_IIO
+	help
+	  Enable this to support Bosch BNO055 IMUs attached via I2C bus.
+
+	  This driver can also be built as a module. If so, the module will be
+	  called bno055_i2c.
drivers/iio/imu/bno055/Makefile +2 -0
index 212307ce9c08..f0be80accb5b 100644
@@ -6,3 +6,5 @@ bno055_ser-y := bno055_ser_core.o
 # define_trace.h needs to know how to find our header
 CFLAGS_bno055_ser_trace.o := -I$(src)
 bno055_ser-$(CONFIG_TRACING) += bno055_ser_trace.o
+
+obj-$(CONFIG_BOSCH_BNO055_I2C) += bno055_i2c.o
drivers/iio/imu/bno055/bno055_i2c.c new file +57 -0

57 lines not on this page · raw message

Signature · 1 line
2.17.1
#26 lore raw

PATCH v6 14/14 docs: iio: add documentation for BNO055 driver

In reply to [email protected]

From: Andrea Merello <[email protected]>

The bno055 driver is rather complex and have some oddities and not-obvious things that worth to document (e.g. calibration files).

---
 Documentation/iio/bno055.rst | 50 ++++++++++++++++++++++++++++++++++++
 Documentation/iio/index.rst  |  2 ++
 2 files changed, 52 insertions(+)
 create mode 100644 Documentation/iio/bno055.rst
Documentation/iio/bno055.rst new file +50 -0
new file mode 100644
index 000000000000..af21376d7a25
@@ -0,0 +1,50 @@
+.. SPDX-License-Identifier: GPL-2.0
+==============================
+BNO055 driver
+==============================
+
+1. Overview
+===========
+
+This driver supports Bosch BNO055 IMUs (on both serial and I2C busses).
+
+Accelerometer, magnetometer and gyroscope measures are always provided.
+When "fusion_enable" sysfs attribute is set to 1, orientation (both Euler
+angles and quaternion), linear velocity and gravity vector are also
+provided, but some sensor settings (e.g. low pass filtering and range)
+became locked (the IMU firmware controls them).
+
+This driver supports also IIO buffers.
+
+2. Calibration
+==============
+
+The IMU continuously performs an autocalibration procedure if (and only if)
+operating in fusion mode. The magnetometer autocalibration can however be
+disabled writing 0 in the sysfs in_magn_calibration_fast_enable attribute.
+
+The driver provides access to autocalibration flags (i.e. you can known if
+the IMU has successfully autocalibrated) and to the calibration data blob.
+
+The user can save this blob in a firmware file (i.e. in /lib/firmware) that
+the driver looks for at probe time. If found, then the IMU is initialized
+with this calibration data. This saves the user from performing the
+calibration procedure every time (which consist of moving the IMU in
+various way).
+
+The driver looks for calibration data file using two different names: first
+a file whose name is suffixed with the IMU unique ID (exposed in sysfs as
+serial_number) is searched for; this is useful when there is more than one
+IMU instance. If this file is not found, then a "generic" calibration file
+is searched for (which can be used when only one IMU is present, without
+struggling with fancy names, that change on each device).
+
+Valid calibration file names would be e.g.
+ bno055-caldata-0e7c26a33541515120204a35342b04ff.dat
+ bno055-caldata.dat
+
+In non-fusion mode the IIO 'offset' attributes provide access to the
+offsets from calibration data (if any), so that the user can apply them to
+the accel, angvel and magn IIO attributes. In fusion mode they are not
+needed (the IMU firmware internally applies those corrections) and they
+read as zero.
Documentation/iio/index.rst +2 -0
index 58b7a4ebac51..1b7292c58cd0 100644
@@ -10,3 +10,5 @@ Industrial I/O
    iio_configfs
 
    ep93xx_adc
+
+   bno055
Signature · 1 line
2.17.1
#27 lore raw

Re: [v6 14/14] docs: iio: add documentation for BNO055 driver

Thank you for the patch! Perhaps something to improve:

Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on jic23-iio/togreg]
[also build test WARNING on linus/master v5.19-rc4 next-20220701] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/intel-lab-lkp/linux/commits/andrea-merello-iit-it/Add-support-for-Bosch-BNO055-IMU/20220614-203754
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
reproduce: make htmldocs

If you fix the issue, kindly add following tag where applicable

All warnings (new ones prefixed by >>):

>> Documentation/iio/bno055.rst:2: WARNING: Explicit markup ends without a blank line; unexpected unindent.

vim +2 Documentation/iio/bno055.rst

   > 2	==============================
     3	BNO055 driver
     4	==============================
     5	
Signature · 2 lines
0-DAY CI Kernel Test Service
https://01.org/lkp

#
# Automatically generated file; DO NOT EDIT.
# Linux/x86_64 5.19.0-rc1 Kernel Configuration #
CONFIG_CC_VERSION_TEXT="gcc-11 (Debian 11.3.0-3) 11.3.0" CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=110300 CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=23800
CONFIG_LD_IS_BFD=y
CONFIG_LD_VERSION=23800
CONFIG_LLD_VERSION=0
CONFIG_CC_CAN_LINK=y CONFIG_CC_CAN_LINK_STATIC=y CONFIG_CC_HAS_ASM_GOTO=y CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y CONFIG_CC_HAS_ASM_INLINE=y CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y CONFIG_PAHOLE_VERSION=123
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_TABLE_SORT=y CONFIG_THREAD_INFO_IN_TASK=y

#
# General setup
#
CONFIG_BROKEN_ON_SMP=y
CONFIG_INIT_ENV_ARG_LIMIT=32
# CONFIG_COMPILE_TEST is not set
# CONFIG_WERROR is not set
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_BUILD_SALT=""
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_HAVE_KERNEL_LZ4=y
CONFIG_HAVE_KERNEL_ZSTD=y
CONFIG_KERNEL_GZIP=y
# CONFIG_KERNEL_BZIP2 is not set
# CONFIG_KERNEL_LZMA is not set
# CONFIG_KERNEL_XZ is not set
# CONFIG_KERNEL_LZO is not set
# CONFIG_KERNEL_LZ4 is not set
# CONFIG_KERNEL_ZSTD is not set
CONFIG_DEFAULT_INIT=""
CONFIG_DEFAULT_HOSTNAME="(none)"
# CONFIG_SYSVIPC is not set
# CONFIG_WATCH_QUEUE is not set
# CONFIG_CROSS_MEMORY_ATTACH is not set
# CONFIG_USELIB is not set
CONFIG_HAVE_ARCH_AUDITSYSCALL=y

#
# IRQ subsystem
#
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_DOMAIN_HIERARCHY=y
CONFIG_GENERIC_IRQ_MATRIX_ALLOCATOR=y
CONFIG_GENERIC_IRQ_RESERVATION_MODE=y
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y

# end of IRQ subsystem

CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_ARCH_CLOCKSOURCE_INIT=y
CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_HAVE_POSIX_CPU_TIMERS_TASK_WORK=y
CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y

#
# Timers subsystem
#
CONFIG_HZ_PERIODIC=y
# CONFIG_NO_HZ_IDLE is not set
# CONFIG_NO_HZ is not set
# CONFIG_HIGH_RES_TIMERS is not set
CONFIG_CLOCKSOURCE_WATCHDOG_MAX_SKEW_US=100

# end of Timers subsystem

CONFIG_HAVE_EBPF_JIT=y
CONFIG_ARCH_WANT_DEFAULT_BPF_JIT=y

#
# BPF subsystem
#
# CONFIG_BPF_SYSCALL is not set

# end of BPF subsystem

CONFIG_PREEMPT_NONE_BUILD=y
CONFIG_PREEMPT_NONE=y
# CONFIG_PREEMPT_VOLUNTARY is not set
# CONFIG_PREEMPT is not set
# CONFIG_PREEMPT_DYNAMIC is not set

#
# CPU/Task time and stats accounting
#
CONFIG_TICK_CPU_ACCOUNTING=y
# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set
# CONFIG_IRQ_TIME_ACCOUNTING is not set
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_PSI is not set

# end of CPU/Task time and stats accounting

#
# RCU Subsystem
#
CONFIG_TINY_RCU=y
# CONFIG_RCU_EXPERT is not set
CONFIG_SRCU=y
CONFIG_TINY_SRCU=y

# end of RCU Subsystem

# CONFIG_IKCONFIG is not set
# CONFIG_IKHEADERS is not set
CONFIG_LOG_BUF_SHIFT=17
CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y

#
# Scheduler features
#

# end of Scheduler features

CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y CONFIG_CC_HAS_INT128=y CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" CONFIG_ARCH_SUPPORTS_INT128=y
# CONFIG_CGROUPS is not set
CONFIG_NAMESPACES=y
# CONFIG_UTS_NS is not set
# CONFIG_TIME_NS is not set
# CONFIG_USER_NS is not set
# CONFIG_PID_NS is not set
# CONFIG_CHECKPOINT_RESTORE is not set
# CONFIG_SCHED_AUTOGROUP is not set
# CONFIG_SYSFS_DEPRECATED is not set
# CONFIG_RELAY is not set
# CONFIG_BLK_DEV_INITRD is not set
# CONFIG_BOOT_CONFIG is not set
# CONFIG_INITRAMFS_PRESERVE_MTIME is not set CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_LD_ORPHAN_WARN=y
CONFIG_SYSCTL=y
CONFIG_SYSCTL_EXCEPTION_TRACE=y CONFIG_HAVE_PCSPKR_PLATFORM=y
# CONFIG_EXPERT is not set
CONFIG_MULTIUSER=y
CONFIG_SGETMASK_SYSCALL=y
CONFIG_SYSFS_SYSCALL=y
CONFIG_FHANDLE=y
CONFIG_POSIX_TIMERS=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_PCSPKR_PLATFORM=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_FUTEX_PI=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_AIO=y
CONFIG_IO_URING=y
CONFIG_ADVISE_SYSCALLS=y
CONFIG_MEMBARRIER=y
CONFIG_KALLSYMS=y CONFIG_KALLSYMS_BASE_RELATIVE=y CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y CONFIG_RSEQ=y
# CONFIG_EMBEDDED is not set CONFIG_HAVE_PERF_EVENTS=y

#
# Kernel Performance Events And Counters
#
CONFIG_PERF_EVENTS=y

# end of Kernel Performance Events And Counters

# CONFIG_PROFILING is not set

# end of General setup

CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_MMU=y
CONFIG_ARCH_MMAP_RND_BITS_MIN=28
CONFIG_ARCH_MMAP_RND_BITS_MAX=32
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_NR_GPIO=1024
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_AUDIT_ARCH=y
CONFIG_ARCH_SUPPORTS_UPROBES=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_PGTABLE_LEVELS=4
CONFIG_CC_HAS_SANE_STACKPROTECTOR=y

#
# Processor type and features
#
# CONFIG_SMP is not set CONFIG_X86_FEATURE_NAMES=y CONFIG_X86_MPPARSE=y
# CONFIG_GOLDFISH is not set
# CONFIG_RETPOLINE is not set CONFIG_CC_HAS_SLS=y
# CONFIG_SLS is not set
# CONFIG_X86_CPU_RESCTRL is not set
# CONFIG_X86_EXTENDED_PLATFORM is not set
# CONFIG_SCHED_OMIT_FRAME_POINTER is not set # CONFIG_HYPERVISOR_GUEST is not set
# CONFIG_MK8 is not set
# CONFIG_MPSC is not set
# CONFIG_MCORE2 is not set
# CONFIG_MATOM is not set CONFIG_GENERIC_CPU=y CONFIG_X86_INTERNODE_CACHE_SHIFT=6 CONFIG_X86_L1_CACHE_SHIFT=6
CONFIG_X86_TSC=y
CONFIG_X86_CMPXCHG64=y
CONFIG_X86_CMOV=y CONFIG_X86_MINIMUM_CPU_FAMILY=64 CONFIG_X86_DEBUGCTLMSR=y CONFIG_IA32_FEAT_CTL=y CONFIG_X86_VMX_FEATURE_NAMES=y CONFIG_CPU_SUP_INTEL=y
CONFIG_CPU_SUP_AMD=y
CONFIG_CPU_SUP_HYGON=y CONFIG_CPU_SUP_CENTAUR=y CONFIG_CPU_SUP_ZHAOXIN=y
CONFIG_HPET_TIMER=y
CONFIG_DMI=y
CONFIG_NR_CPUS_RANGE_BEGIN=1 CONFIG_NR_CPUS_RANGE_END=1 CONFIG_NR_CPUS_DEFAULT=1
CONFIG_NR_CPUS=1
CONFIG_UP_LATE_INIT=y CONFIG_X86_LOCAL_APIC=y
CONFIG_X86_IO_APIC=y
# CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS is not set # CONFIG_X86_MCE is not set

#
# Performance monitoring
#
# CONFIG_PERF_EVENTS_AMD_POWER is not set
# CONFIG_PERF_EVENTS_AMD_UNCORE is not set
# CONFIG_PERF_EVENTS_AMD_BRS is not set

# end of Performance monitoring

CONFIG_X86_16BIT=y
CONFIG_X86_ESPFIX64=y CONFIG_X86_VSYSCALL_EMULATION=y
# CONFIG_X86_IOPL_IOPERM is not set
# CONFIG_MICROCODE is not set
# CONFIG_X86_MSR is not set
# CONFIG_X86_CPUID is not set
# CONFIG_X86_5LEVEL is not set CONFIG_X86_DIRECT_GBPAGES=y
# CONFIG_AMD_MEM_ENCRYPT is not set CONFIG_ARCH_SPARSEMEM_ENABLE=y CONFIG_ARCH_SPARSEMEM_DEFAULT=y CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 # CONFIG_X86_CHECK_BIOS_CORRUPTION is not set CONFIG_MTRR=y
# CONFIG_MTRR_SANITIZER is not set CONFIG_X86_PAT=y CONFIG_ARCH_USES_PG_UNCACHED=y CONFIG_ARCH_RANDOM=y
CONFIG_X86_UMIP=y
CONFIG_CC_HAS_IBT=y
# CONFIG_X86_KERNEL_IBT is not set
# CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS is not set CONFIG_X86_INTEL_TSX_MODE_OFF=y
# CONFIG_X86_INTEL_TSX_MODE_ON is not set
# CONFIG_X86_INTEL_TSX_MODE_AUTO is not set # CONFIG_HZ_100 is not set
CONFIG_HZ_250=y
# CONFIG_HZ_300 is not set
# CONFIG_HZ_1000 is not set
CONFIG_HZ=250
# CONFIG_KEXEC is not set
# CONFIG_CRASH_DUMP is not set CONFIG_PHYSICAL_START=0x1000000
# CONFIG_RELOCATABLE is not set CONFIG_PHYSICAL_ALIGN=0x200000 CONFIG_LEGACY_VSYSCALL_XONLY=y
# CONFIG_LEGACY_VSYSCALL_NONE is not set
# CONFIG_CMDLINE_BOOL is not set CONFIG_MODIFY_LDT_SYSCALL=y
# CONFIG_STRICT_SIGALTSTACK_SIZE is not set CONFIG_HAVE_LIVEPATCH=y

# end of Processor type and features

CONFIG_ARCH_HAS_ADD_PAGES=y
CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y

#
# Power management and ACPI options
#
# CONFIG_SUSPEND is not set
# CONFIG_PM is not set
CONFIG_ARCH_SUPPORTS_ACPI=y
# CONFIG_ACPI is not set

#
# CPU Frequency scaling
#
# CONFIG_CPU_FREQ is not set

# end of CPU Frequency scaling

#
# CPU Idle
#
# CONFIG_CPU_IDLE is not set

# end of CPU Idle
# end of Power management and ACPI options

#
# Bus options (PCI etc.)
#
CONFIG_ISA_DMA_API=y

# end of Bus options (PCI etc.)

#
# Binary Emulations
#
# CONFIG_IA32_EMULATION is not set
# CONFIG_X86_X32_ABI is not set

# end of Binary Emulations

CONFIG_HAVE_KVM=y
# CONFIG_VIRTUALIZATION is not set
CONFIG_AS_AVX512=y
CONFIG_AS_SHA1_NI=y
CONFIG_AS_SHA256_NI=y
CONFIG_AS_TPAUSE=y

#
# General architecture-dependent options
#
CONFIG_GENERIC_ENTRY=y
# CONFIG_JUMP_LABEL is not set
# CONFIG_STATIC_CALL_SELFTEST is not set CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y CONFIG_ARCH_USE_BUILTIN_BSWAP=y CONFIG_HAVE_IOREMAP_PROT=y CONFIG_HAVE_KPROBES=y CONFIG_HAVE_KRETPROBES=y CONFIG_HAVE_OPTPROBES=y CONFIG_HAVE_KPROBES_ON_FTRACE=y CONFIG_ARCH_CORRECT_STACKTRACE_ON_KRETPROBE=y CONFIG_HAVE_FUNCTION_ERROR_INJECTION=y CONFIG_HAVE_NMI=y CONFIG_TRACE_IRQFLAGS_SUPPORT=y CONFIG_HAVE_ARCH_TRACEHOOK=y CONFIG_HAVE_DMA_CONTIGUOUS=y CONFIG_GENERIC_SMP_IDLE_THREAD=y CONFIG_ARCH_HAS_FORTIFY_SOURCE=y CONFIG_ARCH_HAS_SET_MEMORY=y CONFIG_ARCH_HAS_SET_DIRECT_MAP=y CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT=y CONFIG_ARCH_WANTS_NO_INSTR=y CONFIG_HAVE_ASM_MODVERSIONS=y CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y CONFIG_HAVE_RSEQ=y CONFIG_HAVE_FUNCTION_ARG_ACCESS_API=y CONFIG_HAVE_HW_BREAKPOINT=y CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y CONFIG_HAVE_USER_RETURN_NOTIFIER=y CONFIG_HAVE_PERF_EVENTS_NMI=y CONFIG_HAVE_HARDLOCKUP_DETECTOR_PERF=y CONFIG_HAVE_PERF_REGS=y CONFIG_HAVE_PERF_USER_STACK_DUMP=y CONFIG_HAVE_ARCH_JUMP_LABEL=y CONFIG_HAVE_ARCH_JUMP_LABEL_RELATIVE=y CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y CONFIG_HAVE_CMPXCHG_LOCAL=y CONFIG_HAVE_CMPXCHG_DOUBLE=y CONFIG_HAVE_ARCH_SECCOMP=y CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
# CONFIG_SECCOMP is not set CONFIG_HAVE_ARCH_STACKLEAK=y CONFIG_HAVE_STACKPROTECTOR=y
# CONFIG_STACKPROTECTOR is not set CONFIG_ARCH_SUPPORTS_LTO_CLANG=y CONFIG_ARCH_SUPPORTS_LTO_CLANG_THIN=y CONFIG_LTO_NONE=y CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES=y CONFIG_HAVE_CONTEXT_TRACKING=y CONFIG_HAVE_CONTEXT_TRACKING_OFFSTACK=y CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y CONFIG_HAVE_MOVE_PUD=y CONFIG_HAVE_MOVE_PMD=y CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD=y CONFIG_HAVE_ARCH_HUGE_VMAP=y CONFIG_HAVE_ARCH_HUGE_VMALLOC=y CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y CONFIG_HAVE_ARCH_SOFT_DIRTY=y CONFIG_HAVE_MOD_ARCH_SPECIFIC=y CONFIG_MODULES_USE_ELF_RELA=y CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK=y CONFIG_ARCH_HAS_ELF_RANDOMIZE=y CONFIG_HAVE_ARCH_MMAP_RND_BITS=y CONFIG_HAVE_EXIT_THREAD=y CONFIG_ARCH_MMAP_RND_BITS=28 CONFIG_PAGE_SIZE_LESS_THAN_64KB=y CONFIG_PAGE_SIZE_LESS_THAN_256KB=y CONFIG_HAVE_OBJTOOL=y CONFIG_HAVE_JUMP_LABEL_HACK=y CONFIG_HAVE_NOINSTR_HACK=y CONFIG_HAVE_NOINSTR_VALIDATION=y CONFIG_HAVE_UACCESS_VALIDATION=y CONFIG_HAVE_STACK_VALIDATION=y CONFIG_HAVE_RELIABLE_STACKTRACE=y
# CONFIG_COMPAT_32BIT_TIME is not set CONFIG_HAVE_ARCH_VMAP_STACK=y
# CONFIG_VMAP_STACK is not set CONFIG_HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET=y CONFIG_RANDOMIZE_KSTACK_OFFSET=y
# CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT is not set CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y CONFIG_STRICT_KERNEL_RWX=y CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y CONFIG_HAVE_ARCH_PREL32_RELOCATIONS=y CONFIG_ARCH_HAS_MEM_ENCRYPT=y CONFIG_HAVE_STATIC_CALL=y CONFIG_HAVE_STATIC_CALL_INLINE=y CONFIG_HAVE_PREEMPT_DYNAMIC=y CONFIG_HAVE_PREEMPT_DYNAMIC_CALL=y CONFIG_ARCH_WANT_LD_ORPHAN_WARN=y CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y CONFIG_ARCH_SUPPORTS_PAGE_TABLE_CHECK=y CONFIG_ARCH_HAS_ELFCORE_COMPAT=y CONFIG_ARCH_HAS_PARANOID_L1D_FLUSH=y CONFIG_DYNAMIC_SIGFRAME=y

#
# GCOV-based kernel profiling
#
CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y

# end of GCOV-based kernel profiling

CONFIG_HAVE_GCC_PLUGINS=y
# CONFIG_GCC_PLUGINS is not set

# end of General architecture-dependent options

CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
# CONFIG_MODULES is not set
CONFIG_MODULES_TREE_LOOKUP=y
CONFIG_BLOCK=y
# CONFIG_BLOCK_LEGACY_AUTOLOAD is not set
# CONFIG_BLK_DEV_BSGLIB is not set
# CONFIG_BLK_DEV_INTEGRITY is not set
# CONFIG_BLK_DEV_ZONED is not set
# CONFIG_BLK_WBT is not set
# CONFIG_BLK_SED_OPAL is not set
# CONFIG_BLK_INLINE_ENCRYPTION is not set

#
# Partition Types
#
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y
CONFIG_EFI_PARTITION=y

# end of Partition Types

#
# IO Schedulers
#
# CONFIG_MQ_IOSCHED_DEADLINE is not set
# CONFIG_MQ_IOSCHED_KYBER is not set
# CONFIG_IOSCHED_BFQ is not set

# end of IO Schedulers

CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
CONFIG_INLINE_READ_UNLOCK=y
CONFIG_INLINE_READ_UNLOCK_IRQ=y
CONFIG_INLINE_WRITE_UNLOCK=y
CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y
CONFIG_ARCH_USE_QUEUED_RWLOCKS=y
CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE=y
CONFIG_ARCH_HAS_SYNC_CORE_BEFORE_USERMODE=y
CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y

#
# Executable file formats
#
# CONFIG_BINFMT_ELF is not set
# CONFIG_BINFMT_SCRIPT is not set
# CONFIG_BINFMT_MISC is not set
CONFIG_COREDUMP=y

# end of Executable file formats

#
# Memory Management options
#
# CONFIG_SWAP is not set

#
# SLAB allocator options
#
# CONFIG_SLAB is not set
CONFIG_SLUB=y
# CONFIG_SLAB_MERGE_DEFAULT is not set
# CONFIG_SLAB_FREELIST_RANDOM is not set
# CONFIG_SLAB_FREELIST_HARDENED is not set
# CONFIG_SLUB_STATS is not set

# end of SLAB allocator options

# CONFIG_SHUFFLE_PAGE_ALLOCATOR is not set
# CONFIG_COMPAT_BRK is not set
CONFIG_SPARSEMEM=y
CONFIG_SPARSEMEM_EXTREME=y
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
# CONFIG_SPARSEMEM_VMEMMAP is not set
CONFIG_HAVE_FAST_GUP=y
CONFIG_EXCLUSIVE_SYSTEM_RAM=y
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
# CONFIG_MEMORY_HOTPLUG is not set
CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y
# CONFIG_COMPACTION is not set
# CONFIG_PAGE_REPORTING is not set
CONFIG_PHYS_ADDR_T_64BIT=y
CONFIG_VIRT_TO_BUS=y
# CONFIG_KSM is not set
CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
CONFIG_ARCH_WANTS_THP_SWAP=y
# CONFIG_TRANSPARENT_HUGEPAGE is not set
CONFIG_NEED_PER_CPU_KM=y
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
# CONFIG_CMA is not set
CONFIG_GENERIC_EARLY_IOREMAP=y
# CONFIG_IDLE_PAGE_TRACKING is not set
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_ARCH_HAS_CURRENT_STACK_POINTER=y
CONFIG_ARCH_HAS_VM_GET_PAGE_PROT=y
CONFIG_ARCH_HAS_PTE_DEVMAP=y
CONFIG_ZONE_DMA=y
CONFIG_ZONE_DMA32=y
CONFIG_VM_EVENT_COUNTERS=y
# CONFIG_PERCPU_STATS is not set

#
# GUP_TEST needs to have DEBUG_FS enabled
#
CONFIG_ARCH_HAS_PTE_SPECIAL=y
CONFIG_SECRETMEM=y
# CONFIG_ANON_VMA_NAME is not set
# CONFIG_USERFAULTFD is not set

#
# Data Access Monitoring
#
# CONFIG_DAMON is not set

# end of Data Access Monitoring
# end of Memory Management options

# CONFIG_NET is not set

#
# Device Drivers
#
CONFIG_HAVE_EISA=y
# CONFIG_EISA is not set
CONFIG_HAVE_PCI=y
# CONFIG_PCI is not set
# CONFIG_PCCARD is not set

#
# Generic Driver Options
#
# CONFIG_UEVENT_HELPER is not set
# CONFIG_DEVTMPFS is not set
# CONFIG_STANDALONE is not set
# CONFIG_PREVENT_FIRMWARE_BUILD is not set

#
# Firmware loader
#
CONFIG_FW_LOADER=y
CONFIG_EXTRA_FIRMWARE=""
# CONFIG_FW_LOADER_USER_HELPER is not set
# CONFIG_FW_LOADER_COMPRESS is not set
# CONFIG_FW_UPLOAD is not set

# end of Firmware loader

CONFIG_ALLOW_DEV_COREDUMP=y
CONFIG_GENERIC_CPU_AUTOPROBE=y
CONFIG_GENERIC_CPU_VULNERABILITIES=y

# end of Generic Driver Options

#
# Bus devices
#
# CONFIG_MHI_BUS is not set
# CONFIG_MHI_BUS_EP is not set

# end of Bus devices

#
# Firmware Drivers
#

#
# ARM System Control and Management Interface Protocol #

# end of ARM System Control and Management Interface Protocol

# CONFIG_EDD is not set
CONFIG_FIRMWARE_MEMMAP=y
# CONFIG_DMIID is not set
# CONFIG_DMI_SYSFS is not set
CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y
# CONFIG_FW_CFG_SYSFS is not set
# CONFIG_SYSFB_SIMPLEFB is not set
# CONFIG_GOOGLE_FIRMWARE is not set

#
# Tegra firmware driver
#

# end of Tegra firmware driver
# end of Firmware Drivers

# CONFIG_GNSS is not set
# CONFIG_MTD is not set
# CONFIG_OF is not set
CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
# CONFIG_PARPORT is not set
# CONFIG_BLK_DEV is not set

#
# NVME Support
#
# CONFIG_NVME_FC is not set

# end of NVME Support

#
# Misc devices
#
# CONFIG_DUMMY_IRQ is not set
# CONFIG_ENCLOSURE_SERVICES is not set
# CONFIG_SRAM is not set
# CONFIG_XILINX_SDFEC is not set
# CONFIG_C2PORT is not set

#
# EEPROM support
#
# CONFIG_EEPROM_93CX6 is not set

# end of EEPROM support

#
# Texas Instruments shared transport line discipline #

# end of Texas Instruments shared transport line discipline

#
# Altera FPGA firmware download module (requires I2C) #
# CONFIG_ECHO is not set
# CONFIG_PVPANIC is not set

# end of Misc devices

#
# SCSI device support
#
CONFIG_SCSI_MOD=y
# CONFIG_RAID_ATTRS is not set
# CONFIG_SCSI is not set

# end of SCSI device support

# CONFIG_ATA is not set
# CONFIG_MD is not set
# CONFIG_TARGET_CORE is not set
# CONFIG_MACINTOSH_DRIVERS is not set

#
# Input device support
#
CONFIG_INPUT=y
# CONFIG_INPUT_FF_MEMLESS is not set
# CONFIG_INPUT_SPARSEKMAP is not set
# CONFIG_INPUT_MATRIXKMAP is not set

#
# Userland interfaces
#
# CONFIG_INPUT_MOUSEDEV is not set
# CONFIG_INPUT_JOYDEV is not set
# CONFIG_INPUT_EVDEV is not set
# CONFIG_INPUT_EVBUG is not set

#
# Input Device Drivers
#
# CONFIG_INPUT_KEYBOARD is not set
# CONFIG_INPUT_MOUSE is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TABLET is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
# CONFIG_INPUT_MISC is not set
# CONFIG_RMI4_CORE is not set

#
# Hardware I/O ports
#
# CONFIG_SERIO is not set
CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
# CONFIG_GAMEPORT is not set

# end of Hardware I/O ports
# end of Input device support

#
# Character devices
#
CONFIG_TTY=y
CONFIG_VT=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_VT_CONSOLE=y
CONFIG_HW_CONSOLE=y
# CONFIG_VT_HW_CONSOLE_BINDING is not set
CONFIG_UNIX98_PTYS=y
# CONFIG_LEGACY_PTYS is not set
# CONFIG_LDISC_AUTOLOAD is not set

#
# Serial drivers
#
# CONFIG_SERIAL_8250 is not set

#
# Non-8250 serial port support
#
# CONFIG_SERIAL_UARTLITE is not set
# CONFIG_SERIAL_LANTIQ is not set
# CONFIG_SERIAL_SCCNXP is not set
# CONFIG_SERIAL_ALTERA_JTAGUART is not set
# CONFIG_SERIAL_ALTERA_UART is not set
# CONFIG_SERIAL_ARC is not set
# CONFIG_SERIAL_FSL_LPUART is not set
# CONFIG_SERIAL_FSL_LINFLEXUART is not set

# end of Serial drivers

# CONFIG_SERIAL_NONSTANDARD is not set
# CONFIG_NULL_TTY is not set
# CONFIG_SERIAL_DEV_BUS is not set
# CONFIG_VIRTIO_CONSOLE is not set
# CONFIG_IPMI_HANDLER is not set
# CONFIG_HW_RANDOM is not set
# CONFIG_MWAVE is not set
# CONFIG_DEVMEM is not set
# CONFIG_NVRAM is not set
# CONFIG_HANGCHECK_TIMER is not set
# CONFIG_TCG_TPM is not set
# CONFIG_TELCLOCK is not set
# CONFIG_RANDOM_TRUST_CPU is not set
# CONFIG_RANDOM_TRUST_BOOTLOADER is not set

# end of Character devices

#
# I2C support
#
# CONFIG_I2C is not set

# end of I2C support

# CONFIG_I3C is not set
# CONFIG_SPI is not set
# CONFIG_SPMI is not set
# CONFIG_HSI is not set
# CONFIG_PPS is not set

#
# PTP clock support
#
CONFIG_PTP_1588_CLOCK_OPTIONAL=y

#
# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks. #

# end of PTP clock support

# CONFIG_PINCTRL is not set
# CONFIG_GPIOLIB is not set
# CONFIG_W1 is not set
# CONFIG_POWER_RESET is not set
# CONFIG_POWER_SUPPLY is not set
# CONFIG_HWMON is not set
# CONFIG_THERMAL is not set
# CONFIG_WATCHDOG is not set
CONFIG_SSB_POSSIBLE=y
# CONFIG_SSB is not set
CONFIG_BCMA_POSSIBLE=y
# CONFIG_BCMA is not set

#
# Multifunction device drivers
#
# CONFIG_MFD_MADERA is not set
# CONFIG_HTC_PASIC3 is not set
# CONFIG_MFD_KEMPLD is not set
# CONFIG_MFD_MT6397 is not set
# CONFIG_MFD_SM501 is not set
# CONFIG_MFD_SYSCON is not set
# CONFIG_MFD_TI_AM335X_TSCADC is not set
# CONFIG_MFD_TQMX86 is not set

# end of Multifunction device drivers

# CONFIG_REGULATOR is not set
# CONFIG_RC_CORE is not set

#
# CEC support
#
# CONFIG_MEDIA_CEC_SUPPORT is not set

# end of CEC support

# CONFIG_MEDIA_SUPPORT is not set

#
# Graphics support
#
# CONFIG_DRM is not set

#
# ARM devices
#

# end of ARM devices

#
# Frame buffer Devices
#
# CONFIG_FB is not set

# end of Frame buffer Devices

#
# Backlight & LCD device support
#
# CONFIG_LCD_CLASS_DEVICE is not set
# CONFIG_BACKLIGHT_CLASS_DEVICE is not set

# end of Backlight & LCD device support

#
# Console display driver support
#
CONFIG_VGA_CONSOLE=y
CONFIG_DUMMY_CONSOLE=y
CONFIG_DUMMY_CONSOLE_COLUMNS=80
CONFIG_DUMMY_CONSOLE_ROWS=25

# end of Console display driver support
# end of Graphics support

# CONFIG_SOUND is not set

#
# HID support
#
# CONFIG_HID is not set

# end of HID support

CONFIG_USB_OHCI_LITTLE_ENDIAN=y
# CONFIG_USB_SUPPORT is not set
# CONFIG_MMC is not set
# CONFIG_MEMSTICK is not set
# CONFIG_NEW_LEDS is not set
# CONFIG_ACCESSIBILITY is not set
CONFIG_EDAC_ATOMIC_SCRUB=y
CONFIG_EDAC_SUPPORT=y
CONFIG_RTC_LIB=y
CONFIG_RTC_MC146818_LIB=y
# CONFIG_RTC_CLASS is not set
# CONFIG_DMADEVICES is not set

#
# DMABUF options
#
# CONFIG_SYNC_FILE is not set
# CONFIG_DMABUF_HEAPS is not set

# end of DMABUF options

# CONFIG_AUXDISPLAY is not set
# CONFIG_UIO is not set
# CONFIG_VFIO is not set
# CONFIG_VIRT_DRIVERS is not set
# CONFIG_VIRTIO_MENU is not set
# CONFIG_VHOST_MENU is not set

#
# Microsoft Hyper-V guest support
#

# end of Microsoft Hyper-V guest support

# CONFIG_GREYBUS is not set
# CONFIG_COMEDI is not set
# CONFIG_STAGING is not set
# CONFIG_X86_PLATFORM_DEVICES is not set
# CONFIG_CHROME_PLATFORMS is not set
# CONFIG_MELLANOX_PLATFORM is not set
# CONFIG_SURFACE_PLATFORMS is not set
# CONFIG_COMMON_CLK is not set
# CONFIG_HWSPINLOCK is not set

#
# Clock Source drivers
#
CONFIG_CLKEVT_I8253=y
CONFIG_I8253_LOCK=y
CONFIG_CLKBLD_I8253=y

# end of Clock Source drivers

# CONFIG_MAILBOX is not set
# CONFIG_IOMMU_SUPPORT is not set

#
# Remoteproc drivers
#
# CONFIG_REMOTEPROC is not set

# end of Remoteproc drivers

#
# Rpmsg drivers
#
# CONFIG_RPMSG_VIRTIO is not set

# end of Rpmsg drivers

#
# SOC (System On Chip) specific Drivers
#

#
# Amlogic SoC drivers
#

# end of Amlogic SoC drivers

#
# Broadcom SoC drivers
#

# end of Broadcom SoC drivers

#
# NXP/Freescale QorIQ SoC drivers
#

# end of NXP/Freescale QorIQ SoC drivers

#
# i.MX SoC drivers
#

# end of i.MX SoC drivers

#
# Enable LiteX SoC Builder specific drivers
#

# end of Enable LiteX SoC Builder specific drivers

#
# Qualcomm SoC drivers
#

# end of Qualcomm SoC drivers

# CONFIG_SOC_TI is not set

#
# Xilinx SoC drivers
#

# end of Xilinx SoC drivers
# end of SOC (System On Chip) specific Drivers

# CONFIG_PM_DEVFREQ is not set
# CONFIG_EXTCON is not set
# CONFIG_MEMORY is not set
# CONFIG_IIO is not set
# CONFIG_PWM is not set

#
# IRQ chip support
#

# end of IRQ chip support

# CONFIG_IPACK_BUS is not set
# CONFIG_RESET_CONTROLLER is not set

#
# PHY Subsystem
#
# CONFIG_GENERIC_PHY is not set
# CONFIG_PHY_CAN_TRANSCEIVER is not set

#
# PHY drivers for Broadcom platforms
#
# CONFIG_BCM_KONA_USB2_PHY is not set

# end of PHY drivers for Broadcom platforms

# CONFIG_PHY_PXA_28NM_HSIC is not set
# CONFIG_PHY_PXA_28NM_USB2 is not set
# CONFIG_PHY_INTEL_LGM_EMMC is not set

# end of PHY Subsystem

# CONFIG_POWERCAP is not set
# CONFIG_MCB is not set

#
# Performance monitor support
#

# end of Performance monitor support

# CONFIG_RAS is not set

#
# Android
#
# CONFIG_ANDROID is not set

# end of Android

# CONFIG_DAX is not set
# CONFIG_NVMEM is not set

#
# HW tracing support
#
# CONFIG_STM is not set
# CONFIG_INTEL_TH is not set

# end of HW tracing support

# CONFIG_FPGA is not set
# CONFIG_TEE is not set
# CONFIG_SIOX is not set
# CONFIG_SLIMBUS is not set
# CONFIG_INTERCONNECT is not set
# CONFIG_COUNTER is not set
# CONFIG_PECI is not set
# CONFIG_HTE is not set

# end of Device Drivers

#
# File systems
#
CONFIG_DCACHE_WORD_ACCESS=y
# CONFIG_VALIDATE_FS_PARSER is not set
# CONFIG_EXT2_FS is not set
# CONFIG_EXT3_FS is not set
# CONFIG_EXT4_FS is not set
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
# CONFIG_XFS_FS is not set
# CONFIG_GFS2_FS is not set
# CONFIG_BTRFS_FS is not set
# CONFIG_NILFS2_FS is not set
# CONFIG_F2FS_FS is not set
CONFIG_EXPORTFS=y
# CONFIG_EXPORTFS_BLOCK_OPS is not set
CONFIG_FILE_LOCKING=y
# CONFIG_FS_ENCRYPTION is not set
# CONFIG_FS_VERITY is not set
# CONFIG_DNOTIFY is not set
# CONFIG_INOTIFY_USER is not set
# CONFIG_FANOTIFY is not set
# CONFIG_QUOTA is not set
# CONFIG_AUTOFS4_FS is not set
# CONFIG_AUTOFS_FS is not set
# CONFIG_FUSE_FS is not set
# CONFIG_OVERLAY_FS is not set

#
# Caches
#
# CONFIG_FSCACHE is not set

# end of Caches

#
# CD-ROM/DVD Filesystems
#
# CONFIG_ISO9660_FS is not set
# CONFIG_UDF_FS is not set

# end of CD-ROM/DVD Filesystems

#
# DOS/FAT/EXFAT/NT Filesystems
#
# CONFIG_MSDOS_FS is not set
# CONFIG_VFAT_FS is not set
# CONFIG_EXFAT_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS3_FS is not set

# end of DOS/FAT/EXFAT/NT Filesystems

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
# CONFIG_PROC_KCORE is not set
CONFIG_PROC_SYSCTL=y
CONFIG_PROC_PAGE_MONITOR=y
# CONFIG_PROC_CHILDREN is not set
CONFIG_PROC_PID_ARCH_STATUS=y
CONFIG_KERNFS=y
CONFIG_SYSFS=y
# CONFIG_TMPFS is not set
# CONFIG_HUGETLBFS is not set
CONFIG_ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP=y
CONFIG_ARCH_HAS_GIGANTIC_PAGE=y
# CONFIG_CONFIGFS_FS is not set

# end of Pseudo filesystems

# CONFIG_MISC_FILESYSTEMS is not set
# CONFIG_NLS is not set
# CONFIG_UNICODE is not set
CONFIG_IO_WQ=y

# end of File systems

#
# Security options
#
# CONFIG_KEYS is not set
# CONFIG_SECURITY_DMESG_RESTRICT is not set
# CONFIG_SECURITY is not set
# CONFIG_SECURITYFS is not set
# CONFIG_PAGE_TABLE_ISOLATION is not set CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y
# CONFIG_HARDENED_USERCOPY is not set
# CONFIG_FORTIFY_SOURCE is not set
# CONFIG_STATIC_USERMODEHELPER is not set CONFIG_DEFAULT_SECURITY_DAC=y CONFIG_LSM="landlock,lockdown,yama,loadpin,safesetid,integrity,bpf"

#
# Kernel hardening options
#

#
# Memory initialization
#
CONFIG_INIT_STACK_NONE=y
# CONFIG_INIT_ON_ALLOC_DEFAULT_ON is not set
# CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
CONFIG_CC_HAS_ZERO_CALL_USED_REGS=y
# CONFIG_ZERO_CALL_USED_REGS is not set

# end of Memory initialization

CONFIG_RANDSTRUCT_NONE=y

# end of Kernel hardening options
# end of Security options

# CONFIG_CRYPTO is not set

#
# Library routines
#
# CONFIG_PACKING is not set
CONFIG_BITREVERSE=y
CONFIG_GENERIC_STRNCPY_FROM_USER=y
CONFIG_GENERIC_STRNLEN_USER=y
# CONFIG_CORDIC is not set
# CONFIG_PRIME_NUMBERS is not set
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_GENERIC_IOMAP=y
CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
CONFIG_ARCH_HAS_FAST_MULTIPLIER=y
CONFIG_ARCH_USE_SYM_ANNOTATIONS=y

#
# Crypto library routines
#
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
# CONFIG_CRYPTO_LIB_CURVE25519 is not set
CONFIG_CRYPTO_LIB_POLY1305_RSIZE=11
# CONFIG_CRYPTO_LIB_POLY1305 is not set

# end of Crypto library routines

# CONFIG_CRC_CCITT is not set
# CONFIG_CRC16 is not set
# CONFIG_CRC_T10DIF is not set
# CONFIG_CRC64_ROCKSOFT is not set
# CONFIG_CRC_ITU_T is not set
CONFIG_CRC32=y
# CONFIG_CRC32_SELFTEST is not set
CONFIG_CRC32_SLICEBY8=y
# CONFIG_CRC32_SLICEBY4 is not set
# CONFIG_CRC32_SARWATE is not set
# CONFIG_CRC32_BIT is not set
# CONFIG_CRC64 is not set
# CONFIG_CRC4 is not set
# CONFIG_CRC7 is not set
# CONFIG_LIBCRC32C is not set
# CONFIG_CRC8 is not set
# CONFIG_RANDOM32_SELFTEST is not set
# CONFIG_XZ_DEC is not set
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT_MAP=y
CONFIG_HAS_DMA=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
CONFIG_SWIOTLB=y
# CONFIG_DMA_API_DEBUG is not set
# CONFIG_IRQ_POLL is not set
CONFIG_HAVE_GENERIC_VDSO=y
CONFIG_GENERIC_GETTIMEOFDAY=y
CONFIG_GENERIC_VDSO_TIME_NS=y
CONFIG_ARCH_HAS_PMEM_API=y
CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE=y
CONFIG_ARCH_HAS_COPY_MC=y
CONFIG_ARCH_STACKWALK=y
CONFIG_STACKDEPOT=y
CONFIG_STACK_HASH_ORDER=20
CONFIG_SBITMAP=y

# end of Library routines

#
# Kernel hacking
#

#

# printk and dmesg options
#
# CONFIG_PRINTK_TIME is not set
# CONFIG_PRINTK_CALLER is not set
# CONFIG_STACKTRACE_BUILD_ID is not set
CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7
CONFIG_CONSOLE_LOGLEVEL_QUIET=4
CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4
# CONFIG_DYNAMIC_DEBUG is not set
# CONFIG_DYNAMIC_DEBUG_CORE is not set
# CONFIG_SYMBOLIC_ERRNAME is not set
CONFIG_DEBUG_BUGVERBOSE=y
# end of printk and dmesg options

# CONFIG_DEBUG_KERNEL is not set

#
# Compile-time checks and compiler options
#
CONFIG_FRAME_WARN=2048
# CONFIG_STRIP_ASM_SYMS is not set
# CONFIG_HEADERS_INSTALL is not set
CONFIG_DEBUG_SECTION_MISMATCH=y
CONFIG_SECTION_MISMATCH_WARN_ONLY=y
CONFIG_OBJTOOL=y

# end of Compile-time checks and compiler options

#
# Generic Kernel Debugging Instruments
#
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_DEBUG_FS is not set
CONFIG_HAVE_ARCH_KGDB=y
CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
# CONFIG_UBSAN is not set
CONFIG_HAVE_ARCH_KCSAN=y
CONFIG_HAVE_KCSAN_COMPILER=y

# end of Generic Kernel Debugging Instruments

#
# Networking Debugging
#

# end of Networking Debugging

#
# Memory Debugging
#
# CONFIG_PAGE_EXTENSION is not set
CONFIG_SLUB_DEBUG=y
# CONFIG_SLUB_DEBUG_ON is not set
# CONFIG_PAGE_TABLE_CHECK is not set
# CONFIG_PAGE_POISONING is not set
# CONFIG_DEBUG_RODATA_TEST is not set
CONFIG_ARCH_HAS_DEBUG_WX=y
# CONFIG_DEBUG_WX is not set
CONFIG_GENERIC_PTDUMP=y
CONFIG_HAVE_DEBUG_KMEMLEAK=y
CONFIG_ARCH_HAS_DEBUG_VM_PGTABLE=y
# CONFIG_DEBUG_VM_PGTABLE is not set
CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y
CONFIG_DEBUG_MEMORY_INIT=y
CONFIG_ARCH_SUPPORTS_KMAP_LOCAL_FORCE_MAP=y
CONFIG_HAVE_ARCH_KASAN=y
CONFIG_HAVE_ARCH_KASAN_VMALLOC=y
CONFIG_CC_HAS_KASAN_GENERIC=y
CONFIG_CC_HAS_WORKING_NOSANITIZE_ADDRESS=y
# CONFIG_KASAN is not set
CONFIG_HAVE_ARCH_KFENCE=y
# CONFIG_KFENCE is not set

# end of Memory Debugging

#
# Debug Oops, Lockups and Hangs
#
# CONFIG_PANIC_ON_OOPS is not set
CONFIG_PANIC_ON_OOPS_VALUE=0
CONFIG_PANIC_TIMEOUT=0
CONFIG_HARDLOCKUP_CHECK_TIMESTAMP=y

# end of Debug Oops, Lockups and Hangs

#
# Scheduler Debugging
#

# end of Scheduler Debugging

# CONFIG_DEBUG_TIMEKEEPING is not set

#
# Lock Debugging (spinlocks, mutexes, etc...)
#
CONFIG_LOCK_DEBUGGING_SUPPORT=y
# CONFIG_WW_MUTEX_SELFTEST is not set

# end of Lock Debugging (spinlocks, mutexes, etc...)

# CONFIG_DEBUG_IRQFLAGS is not set
CONFIG_STACKTRACE=y
# CONFIG_WARN_ALL_UNSEEDED_RANDOM is not set

#
# Debug kernel data structures
#
# CONFIG_BUG_ON_DATA_CORRUPTION is not set

# end of Debug kernel data structures

#
# RCU Debugging
#

# end of RCU Debugging

CONFIG_USER_STACKTRACE_SUPPORT=y
CONFIG_HAVE_RETHOOK=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_HAVE_FENTRY=y
CONFIG_HAVE_OBJTOOL_MCOUNT=y
CONFIG_HAVE_C_RECORDMCOUNT=y
CONFIG_HAVE_BUILDTIME_MCOUNT_SORT=y
CONFIG_TRACING_SUPPORT=y
# CONFIG_FTRACE is not set
# CONFIG_SAMPLES is not set
CONFIG_HAVE_SAMPLE_FTRACE_DIRECT=y
CONFIG_HAVE_SAMPLE_FTRACE_DIRECT_MULTI=y
CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y

#

# x86 Debugging
#
CONFIG_TRACE_IRQFLAGS_NMI_SUPPORT=y
# CONFIG_X86_VERBOSE_BOOTUP is not set
CONFIG_EARLY_PRINTK=y
CONFIG_HAVE_MMIOTRACE_SUPPORT=y
CONFIG_IO_DELAY_0X80=y
# CONFIG_IO_DELAY_0XED is not set
# CONFIG_IO_DELAY_UDELAY is not set
# CONFIG_IO_DELAY_NONE is not set
CONFIG_UNWINDER_ORC=y
# CONFIG_UNWINDER_FRAME_POINTER is not set
# end of x86 Debugging

#
# Kernel Testing and Coverage
#
# CONFIG_KUNIT is not set
CONFIG_ARCH_HAS_KCOV=y
CONFIG_CC_HAS_SANCOV_TRACE_PC=y
# CONFIG_KCOV is not set
# CONFIG_RUNTIME_TESTING_MENU is not set
CONFIG_ARCH_USE_MEMTEST=y
# CONFIG_MEMTEST is not set

# end of Kernel Testing and Coverage
# end of Kernel hacking
#28 lore raw

Re: [v6 14/14] docs: iio: add documentation for BNO055 driver

Quoted 19 lines · kernel test robot

Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on jic23-iio/togreg]
[also build test WARNING on linus/master v5.19-rc4 next-20220701] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/intel-lab-lkp/linux/commits/andrea-merello-iit-it/Add-support-for-Bosch-BNO055-IMU/20220614-203754
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
reproduce: make htmldocs

If you fix the issue, kindly add following tag where applicable

All warnings (new ones prefixed by >>):

Quoted 9 lines
Quoted 1 line
Quoted 1 line

Documentation/iio/bno055.rst:2: WARNING: Explicit markup ends without a blank line; unexpected unindent.

vim +2 Documentation/iio/bno055.rst

Quoted 1 line

2 ==============================

     3	BNO055 driver
     4	==============================
     5	

Here's the fixup:

---- >8 ----

Quoted 1 line

From bb8524aa4719e54389065548c86155cbee638357 Mon Sep 17 00:00:00 2001

From: Bagas Sanjaya <[email protected]>
Date: Sun, 3 Jul 2022 18:37:44 +0700
Subject: [PATCH] fixup for "docs: iio: add documentation for BNO055 driver"

kernel test robot reported htmldocs warning:

Documentation/iio/bno055.rst:2: WARNING: Explicit markup ends without a blank line; unexpected unindent.

Add missing blank between SPDX line and the page title to fix the warning.

Cc lars(a)metafoo.de
Cc robh+dt(a)kernel.org
Cc andy.shevchenko(a)gmail.com
Cc matt.ranostay(a)konsulko.com
Cc ardeleanalex(a)gmail.com
Cc jacopo(a)jmondi.org
Cc Andrea Merello <[email protected]>
---
 Documentation/iio/bno055.rst | 1 +
 1 file changed, 1 insertion(+)
Documentation/iio/bno055.rst +1 -0
index af21376d7a2533..9a489a79d8f5a8 100644
@@ -1,4 +1,5 @@
 .. SPDX-License-Identifier: GPL-2.0
+
 ==============================
 BNO055 driver
 ==============================

---- >8 ----

Signature · 1 line
An old man doll... just what I always wanted! - Clara
#29 lore raw

Re: [v6 14/14] docs: iio: add documentation for BNO055 driver

Quoted 1 line · Bagas Sanjaya

On Sun, Jul 03, 2022 at 03:58:15PM +0800, kernel test robot wrote:

Please, submit it properly.
You may add my Reviewed-by: Andy Shevchenko <[email protected]>

(I deliberately put it on a wrong line so no tools will catch it up with improper commit message)

Quoted 36 lines

From bb8524aa4719e54389065548c86155cbee638357 Mon Sep 17 00:00:00 2001
From: Bagas Sanjaya <[email protected]>
Date: Sun, 3 Jul 2022 18:37:44 +0700
Subject: [PATCH] fixup for "docs: iio: add documentation for BNO055 driver"

kernel test robot reported htmldocs warning:

Documentation/iio/bno055.rst:2: WARNING: Explicit markup ends without a blank line; unexpected unindent.

Add missing blank between SPDX line and the page title to fix the warning.

Cc lars(a)metafoo.de
Cc robh+dt(a)kernel.org
Cc andy.shevchenko(a)gmail.com
Cc matt.ranostay(a)konsulko.com
Cc ardeleanalex(a)gmail.com
Cc jacopo(a)jmondi.org
Cc Andrea Merello <[email protected]>
---
 Documentation/iio/bno055.rst | 1 +
 1 file changed, 1 insertion(+)
Documentation/iio/bno055.rst +1 -0
index af21376d7a2533..9a489a79d8f5a8 100644
@@ -1,4 +1,5 @@
 .. SPDX-License-Identifier: GPL-2.0
+
 ==============================
 BNO055 driver
 ==============================
Signature · 2 lines
With Best Regards,
Andy Shevchenko
#30 lore raw

Re: [v6 14/14] docs: iio: add documentation for BNO055 driver

Quoted 8 lines · Andy Shevchenko
Quoted 1 line · Bagas Sanjaya

On Sun, Jul 03, 2022 at 03:58:15PM +0800, kernel test robot wrote:

Please, submit it properly.
You may add my Reviewed-by: Andy Shevchenko <[email protected]>

(I deliberately put it on a wrong line so no tools will catch it up with improper commit message)

OK, thanks.

Signature · 1 line
An old man doll... just what I always wanted! - Clara
#31 lore raw

PATCH v2 1/1 Documentation: bno055: separate SPDX identifier and page title

In reply to Bagas Sanjaya

kernel test robot reported htmldocs warning:

Documentation/iio/bno055.rst:2: WARNING: Explicit markup ends without a blank line; unexpected unindent.

The warning above is caused by missing blank line separator between SPDX identifier and page title.

Add the blank line to fix the warning.

Fixes ec0c70cb45507d ("docs: iio: add documentation for BNO055 driver")
Cc Jonathan Corbet <[email protected]>
Cc Andrea Merello <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
Cc Lars-Peter Clausen <[email protected]>
Cc Rob Herring <[email protected]>
Cc Matt Ranostay <[email protected]>
Cc Alexandru Ardelean <[email protected]>
Cc [email protected] (open list)

---

Changes since v1 [1]:
- Collect Reviewed-by from Andy Shevchenko
- Explain why the warning is triggered
- No code changes

This patch is based on "Add support for Bosch BNO055 IMU" series [2] as fixup for BNO055 documentation (patch [14/14])

[1]: https://lore.kernel.org/lkml/[email protected]/
[2]: https://lore.kernel.org/lkml/[email protected]/

 Documentation/iio/bno055.rst | 1 +
 1 file changed, 1 insertion(+)
Documentation/iio/bno055.rst +1 -0
index af21376d7a2533..9a489a79d8f5a8 100644
@@ -1,4 +1,5 @@
 .. SPDX-License-Identifier: GPL-2.0
+
 ==============================
 BNO055 driver
 ==============================
Signature · 1 line
An old man doll... just what I always wanted! - Clara
#32 lore raw

Re: [PATCH v2] Documentation: bno055: separate SPDX identifier and page title

Quoted 15 lines · Bagas Sanjaya

kernel test robot reported htmldocs warning:

Documentation/iio/bno055.rst:2: WARNING: Explicit markup ends without a blank line; unexpected unindent.

The warning above is caused by missing blank line separator between SPDX identifier and page title.

Add the blank line to fix the warning.

Fixes ec0c70cb45507d ("docs: iio: add documentation for BNO055 driver")
Quoted 12 lines
Cc Jonathan Corbet <[email protected]>
Cc Andrea Merello <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
Cc Lars-Peter Clausen <[email protected]>
Cc Rob Herring <[email protected]>
Cc Matt Ranostay <[email protected]>
Cc Alexandru Ardelean <[email protected]>
Cc [email protected] (open list)

It's a very noisy Cc list which will go in the git history. Instead, use --to and --cc parameters of git format-patch. Maintainers usually use b4 tool that adds a Link tag to the patch itself on the Lore archive which will keep track on the Cc list anyway.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#33 lore raw

Re: [PATCH v2] Documentation: bno055: separate SPDX identifier and page title

Quoted 13 lines · Andy Shevchenko
Quoted 4 lines
Cc Jonathan Corbet <[email protected]>
Cc Andrea Merello <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
Quoted 8 lines
Cc Lars-Peter Clausen <[email protected]>
Cc Rob Herring <[email protected]>
Cc Matt Ranostay <[email protected]>
Cc Alexandru Ardelean <[email protected]>
Cc [email protected] (open list)
Quoted 5 lines

It's a very noisy Cc list which will go in the git history. Instead, use --to and --cc parameters of git format-patch. Maintainers usually use b4 tool that adds a Link tag to the patch itself on the Lore archive which will keep track on the Cc list anyway.

Hi Andy,

Thanks for reminding me.

I think something like b4 am -l, right?

Anyway, should I resend (reroll)?

Signature · 1 line
An old man doll... just what I always wanted! - Clara
#34 lore raw

Re: [PATCH v2] Documentation: bno055: separate SPDX identifier and page title

Quoted 1 line · Bagas Sanjaya

On 7/5/22 02:49, Andy Shevchenko wrote:

...

Quoted 18 lines
Quoted 13 lines
Quoted 4 lines
Cc Jonathan Corbet <[email protected]>
Cc Andrea Merello <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
Quoted 8 lines
Cc Lars-Peter Clausen <[email protected]>
Cc Rob Herring <[email protected]>
Cc Matt Ranostay <[email protected]>
Cc Alexandru Ardelean <[email protected]>
Cc [email protected] (open list)
Quoted 4 lines

It's a very noisy Cc list which will go in the git history. Instead, use --to and --cc parameters of git format-patch. Maintainers usually use b4 tool that adds a Link tag to the patch itself on the Lore archive which will keep track on the Cc list anyway.

Quoted 5 lines

Thanks for reminding me.

I think something like b4 am -l, right?

Anyway, should I resend (reroll)?

Depends on the maintainer's wishes. Maybe they can drop them when applying, I dunno.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer
#35 lore raw

Re: [PATCH v2] Documentation: bno055: separate SPDX identifier and page title

Quoted 23 lines · On Tue, 5 Jul 2022 11:02:32 +0200 Andy Shevchenko <[email protected]>…
Quoted 1 line · Bagas Sanjaya

On 7/5/22 02:49, Andy Shevchenko wrote:

...

Quoted 17 lines
Quoted 17 lines
Quoted 4 lines
Cc Jonathan Corbet <[email protected]>
Cc Andrea Merello <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
Quoted 8 lines
Cc Lars-Peter Clausen <[email protected]>
Cc Rob Herring <[email protected]>
Cc Matt Ranostay <[email protected]>
Cc Alexandru Ardelean <[email protected]>
Cc [email protected] (open list)

It's a very noisy Cc list which will go in the git history. Instead, use --to and --cc parameters of git format-patch. Maintainers usually use b4 tool that adds a Link tag to the patch itself on the Lore archive which will keep track on the Cc list anyway.

Quoted 9 lines
Quoted 5 lines

Thanks for reminding me.

I think something like b4 am -l, right?

Anyway, should I resend (reroll)?

Depends on the maintainer's wishes. Maybe they can drop them when applying, I dunno.

At the moment this is a fix to a series we haven't actually accepted. Nice to have an all, but up to Andrea on how to handle it.
One reasonable option would be just to squish it into the original patch for v7 with an appropriate note in the patch description / changelog.

Thanks,

Jonathan