Skip to contentSkip to conversation

iio: add support for Bosch BMX055 IMU

PATCH Superseded Jun Yan 3 participants 10 messages Feb 3 – Feb 6

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Jun Yan

author
#0 lore raw

v3 cover iio: add support for Bosch BMX055 IMU

The BMX055[1] is a Bosch 9-axis IMU integrating a 3-axis accelerometer, gyroscope and geomagnetic sensor.

It supports SPI/I²C interfaces, and existing compatible drivers can be reused by simply adding the corresponding dt-bindings for fallback coompatibles as follows:

- accelerometer: bmc150-accel
- gyroscope: bmg160
- magnetometer: bmc150_magn

Changes in v3:
- Drop the Linux-related comments in the bosch,bma25 dt-bindings.
- Link to v2: https://lore.kernel.org/all/[email protected]/

- Changes in v2:
- Use fallback compatibles instead of introducing a new device ID in the driver.
- Link to v1: https://lore.kernel.org/all/[email protected]/

[1] https://cdn.sparkfun.com/assets/b/9/1/f/4/bst-bmx055-ds000_datasheet.pdf

Jun Yan (3):
dt-bindings: iio: accel: bosch,bma255: add bmx055 accel binding
dt-bindings: iio: magnetometer: bosch,bmc150_magn: add bmx055
magnetometer binding
dt-bindings: iio: gyroscope: bosch,bmg160: add bmx055 gyroscope
binding

 .../bindings/iio/accel/bosch,bma255.yaml      | 41 ++++++++++---------
 .../bindings/iio/gyroscope/bosch,bmg160.yaml  | 12 ++++--
 .../iio/magnetometer/bosch,bmc150_magn.yaml   | 14 ++++---
 3 files changed, 39 insertions(+), 28 deletions(-)
Signature · 1 line
2.52.0
author
#1 lore raw

PATCH v3 1/3 dt-bindings: iio: accel: bosch,bma255: add bmx055 accel binding

Add the device-tree binding for the Bosch BMX055 IMU (accelerometer part), which is compatible with bmc150_accel.

Datasheet: https://cdn.sparkfun.com/assets/b/9/1/f/4/bst-bmx055-ds000_datasheet.pdf

---
 .../bindings/iio/accel/bosch,bma255.yaml      | 41 ++++++++++---------
 1 file changed, 22 insertions(+), 19 deletions(-)
Documentation/devicetree/bindings/iio/accel/bosch,bma255.yaml +22 -19
index c1387e02eb82..969a8ed3f539 100644
@@ -16,25 +16,28 @@ description:
 
 properties:
   compatible:
-    enum:
-      # bmc150-accel driver in Linux
-      - bosch,bma222
-      - bosch,bma222e
-      - bosch,bma250e
-      - bosch,bma253
-      - bosch,bma254
-      - bosch,bma255
-      - bosch,bma280
-      - bosch,bmc150_accel
-      - bosch,bmc156_accel
-      - bosch,bmi055_accel
-
-      # bma180 driver in Linux
-      - bosch,bma023
-      - bosch,bma150
-      - bosch,bma180
-      - bosch,bma250
-      - bosch,smb380
+    oneOf:
+      - enum:
+          - bosch,bma222
+          - bosch,bma222e
+          - bosch,bma250e
+          - bosch,bma253
+          - bosch,bma254
+          - bosch,bma255
+          - bosch,bma280
+          - bosch,bmc150_accel
+          - bosch,bmc156_accel
+          - bosch,bmi055_accel
+          - bosch,bmx055_accel
+
+          - bosch,bma023
+          - bosch,bma150
+          - bosch,bma180
+          - bosch,bma250
+          - bosch,smb380
+      - items:
+          - const: bosch,bmx055
+          - const: bosch,bmc150_accel
 
   reg:
     maxItems: 1
Signature · 1 line
2.52.0
Reviewed-by on v3 1/3
#3 lore raw

Re: [PATCH v3 1/3] dt-bindings: iio: accel: bosch,bma255: add bmx055 accel binding

In reply to Jun Yan
Quoted 5 lines · Jun Yan

Add the device-tree binding for the Bosch BMX055 IMU (accelerometer part), which is compatible with bmc150_accel.

Datasheet: https://cdn.sparkfun.com/assets/b/9/1/f/4/bst-bmx055-ds000_datasheet.pdf

Yours,
Linus Walleij

author
#4 lore raw

PATCH v3 2/3 dt-bindings: iio: magnetometer: bosch,bmc150_magn: add bmx055 magnetometer binding

In reply to Jun Yan

Add the device-tree binding for the bosch BMX055 IMU (magnetometer part), which is compatible with bmc150_magn.

Datasheet: https://cdn.sparkfun.com/assets/b/9/1/f/4/bst-bmx055-ds000_datasheet.pdf

---
 .../iio/magnetometer/bosch,bmc150_magn.yaml        | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/iio/magnetometer/bosch,bmc150_magn.yaml +9 -5
index a3838ab0c524..09d1dc861d4f 100644
@@ -21,11 +21,15 @@ properties:
     description:
       Note the bmm150_magn is a deprecated compatible as this part contains only
       a magnetometer.
-    enum:
-      - bosch,bmc150_magn
-      - bosch,bmc156_magn
-      - bosch,bmm150
-      - bosch,bmm150_magn
+    oneOf:
+      - enum:
+          - bosch,bmc150_magn
+          - bosch,bmc156_magn
+          - bosch,bmm150
+          - bosch,bmm150_magn
+      - items:
+          - const: bosch,bmx055_magn
+          - const: bosch,bmc150_magn
 
   reg:
     maxItems: 1
Signature · 1 line
2.52.0
#5 lore raw

Re: [PATCH v3 2/3] dt-bindings: iio: magnetometer: bosch,bmc150_magn: add bmx055 magnetometer binding

Quoted 21 lines · Jun Yan

Add the device-tree binding for the bosch BMX055 IMU (magnetometer part), which is compatible with bmc150_magn.

Datasheet: https://cdn.sparkfun.com/assets/b/9/1/f/4/bst-bmx055-ds000_datasheet.pdf

---
 .../iio/magnetometer/bosch,bmc150_magn.yaml        | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/iio/magnetometer/bosch,bmc150_magn.yaml +0 -4
index a3838ab0c524..09d1dc861d4f 100644
@@ -21,11 +21,15 @@ properties:
     description:
       Note the bmm150_magn is a deprecated compatible as this part contains only
       a magnetometer.
-    enum:
-      - bosch,bmc150_magn
-      - bosch,bmc156_magn
-      - bosch,bmm150

Documentation/devicetree/bindings/iio/magnetometer/bosch,bmc150_magn.yaml properties: · line 32

Quoted 10 lines
Documentation/devicetree/bindings/iio/magnetometer/bosch,bmc150_magn.yaml +8 -1
-      - bosch,bmm150_magn
+    oneOf:
+      - enum:
+          - bosch,bmc150_magn
+          - bosch,bmc156_magn
+          - bosch,bmm150
+          - bosch,bmm150_magn
+      - items:
 
+          - const: bosch,bmx055_magn

s/_/-/ here please, we don't permit _s in new compatibles.
pw-bot: changes-requested

Quoted 8 lines
Documentation/devicetree/bindings/iio/magnetometer/bosch,bmc150_magn.yaml +1 -0
+          - const: bosch,bmc150_magn
 
   reg:

maxItems: 1

Signature · 1 line
2.52.0
author
#6 lore raw

Re: [PATCH v3 2/3] dt-bindings: iio: magnetometer: bosch,bmc150_magn: add bmx055 magnetometer binding

Hello,

Quoted 37 lines · Jun Yan
Quoted 4 lines

Add the device-tree binding for the bosch BMX055 IMU (magnetometer part), which is compatible with bmc150_magn.
=20
Datasheet: https://cdn.sparkfun.com/assets/b/9/1/f/4/bst-bmx055-ds000_dat=

asheet.pdf

Review

Quoted 6 lines
---
 .../iio/magnetometer/bosch,bmc150_magn.yaml        | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

=20

(quoted diff) +0 -0

150_magn.yaml b/Documentation/devicetree/bindings/iio/magnetometer/bosch,bm= c150_magn.yaml

Quoted 2 lines

index a3838ab0c524..09d1dc861d4f 100644
--- a/Documentation/devicetree/bindings/iio/magnetometer/bosch,bmc150_mag=

n.yaml

Quoted 1 line

+++ b/Documentation/devicetree/bindings/iio/magnetometer/bosch,bmc150_mag=

n.yaml

Review properties: · line 22

Quoted 3 lines
(quoted diff) +0 -0
@@ -21,11 +21,15 @@ properties:
     description:
       Note the bmm150_magn is a deprecated compatible as this part conta=

ins only

Quoted 13 lines
Documentation/devicetree/bindings/iio/magnetometer/bosch,bmc150_magn.yaml +7 -5
       a magnetometer.
-    enum:
-      - bosch,bmc150_magn
-      - bosch,bmc156_magn
-      - bosch,bmm150
-      - bosch,bmm150_magn
+    oneOf:
+      - enum:
+          - bosch,bmc150_magn
+          - bosch,bmc156_magn
+          - bosch,bmm150
+          - bosch,bmm150_magn
+      - items:
Quoted 3 lines

Documentation/devicetree/bindings/iio/magnetometer/bosch,bmc150_magn.yaml properties: · line 31

Quoted 1 line
Documentation/devicetree/bindings/iio/magnetometer/bosch,bmc150_magn.yaml +1 -0
+          - const: bosch,bmx055_magn

s/_/-/ here please, we don't permit _s in new compatibles.

Got it, will change _ to - for the new compatibles.

Best regards,
Jun Yan

Quoted 10 lines

pw-bot: changes-requested

Quoted 8 lines
Documentation/devicetree/bindings/iio/magnetometer/bosch,bmc150_magn.yaml +1 -0
+          - const: bosch,bmc150_magn

=20
reg:
maxItems: 1
--=20
2.52.0
=20
=20

author
#7 lore raw

PATCH v3 3/3 dt-bindings: iio: gyroscope: bosch,bmg160: add bmx055 gyroscope binding

In reply to Jun Yan

Add the device-tree binding for the bosch BMX055 IMU (gyroscope part), which is compatible with bmg160.

Datasheet: https://cdn.sparkfun.com/assets/b/9/1/f/4/bst-bmx055-ds000_datasheet.pdf

---
 .../bindings/iio/gyroscope/bosch,bmg160.yaml         | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/iio/gyroscope/bosch,bmg160.yaml +8 -4
index 3c6fe74af0b8..e19aa1797f14 100644
@@ -11,10 +11,14 @@ maintainers:
 
 properties:
   compatible:
-    enum:
-      - bosch,bmg160
-      - bosch,bmi055_gyro
-      - bosch,bmi088_gyro
+    oneOf:
+      - enum:
+          - bosch,bmg160
+          - bosch,bmi055_gyro
+          - bosch,bmi088_gyro
+      - items:
+          - const: bosch,bmx055_gyro
+          - const: bosch,bmg160
 
   reg:
     maxItems: 1
Signature · 1 line
2.52.0
#8 lore raw

Re: [PATCH v3 3/3] dt-bindings: iio: gyroscope: bosch,bmg160: add bmx055 gyroscope binding

Quoted 18 lines · Jun Yan

Add the device-tree binding for the bosch BMX055 IMU (gyroscope part), which is compatible with bmg160.

Datasheet: https://cdn.sparkfun.com/assets/b/9/1/f/4/bst-bmx055-ds000_datasheet.pdf

---
 .../bindings/iio/gyroscope/bosch,bmg160.yaml         | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/iio/gyroscope/bosch,bmg160.yaml +0 -1
index 3c6fe74af0b8..e19aa1797f14 100644
@@ -11,10 +11,14 @@ maintainers:
 
 properties:
   compatible:
-    enum:

Documentation/devicetree/bindings/iio/gyroscope/bosch,bmg160.yaml maintainers: · line 20

Quoted 10 lines
Documentation/devicetree/bindings/iio/gyroscope/bosch,bmg160.yaml +7 -3
-      - bosch,bmg160
-      - bosch,bmi055_gyro
-      - bosch,bmi088_gyro
+    oneOf:
+      - enum:
+          - bosch,bmg160
+          - bosch,bmi055_gyro
+          - bosch,bmi088_gyro
+      - items:
+          - const: bosch,bmx055_gyro

Same here, please.
pw-bot: changes-requested

Quoted 8 lines
Documentation/devicetree/bindings/iio/gyroscope/bosch,bmg160.yaml +1 -0
+          - const: bosch,bmg160
 
   reg:
     maxItems: 1
Signature · 1 line
2.52.0
Reviewed-by on the v3 series
#9 lore raw
In reply to Jun Yan
Quoted 10 lines · Jun Yan

The BMX055[1] is a Bosch 9-axis IMU integrating a 3-axis accelerometer, gyroscope and geomagnetic sensor.

It supports SPI/I²C interfaces, and existing compatible drivers can be reused by simply adding the corresponding dt-bindings for fallback coompatibles as follows:

- accelerometer: bmc150-accel
- gyroscope: bmg160
- magnetometer: bmc150_magn

The series:

Yours,
Linus Walleij