Skip to contentSkip to conversation

dt-bindings: fxas21002c: convert bindings to yaml

PATCH In review Rui Miguel Silva 3 participants 4 messages Oct 13, 2020 – Oct 14, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt-bindings: fxas21002c: convert bindings to yaml

Convert fxas21002c gyroscope sensor bindings documentation to yaml schema and remove the textual bindings document.

---
 .../bindings/iio/gyroscope/nxp,fxas21002c.txt | 31 --------
 .../iio/gyroscope/nxp,fxas21002c.yaml         | 77 +++++++++++++++++++
 MAINTAINERS                                   |  2 +-
 3 files changed, 78 insertions(+), 32 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.txt
 create mode 100644 Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.txt deleted +0 -31
deleted file mode 100644
index 465e104bbf14..000000000000
@@ -1,31 +0,0 @@
-* NXP FXAS21002C Gyroscope device tree bindings
-
-http://www.nxp.com/products/sensors/gyroscopes/3-axis-digital-gyroscope:FXAS21002C
-
-Required properties:
-  - compatible : should be "nxp,fxas21002c"
-  - reg : the I2C address of the sensor or SPI chip select number for the
-          device.
-  - vdd-supply: phandle to the regulator that provides power to the sensor.
-  - vddio-supply: phandle to the regulator that provides power to the bus.
-
-Optional properties:
-  - reset-gpios : gpio used to reset the device, see gpio/gpio.txt
-  - interrupts : device support 2 interrupts, INT1 and INT2,
-                 the interrupts can be triggered on rising or falling edges.
-                 See interrupt-controller/interrupts.txt
-  - interrupt-names: should contain "INT1" or "INT2", the gyroscope interrupt
-                     line in use.
-  - drive-open-drain: the interrupt/data ready line will be configured
-                      as open drain, which is useful if several sensors share
-                      the same interrupt line. This is a boolean property.
-                      (This binding is taken from pinctrl/pinctrl-bindings.txt)
-
-Example:
-
-gyroscope@20 {
-	compatible = "nxp,fxas21002c";
-	reg = <0x20>;
-	vdd-supply = <&reg_peri_3p15v>;
-	vddio-supply = <&reg_peri_3p15v>;
-};
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +77 -0

77 lines not on this page · raw message

MAINTAINERS +1 -1
index 6594f0966716..2e85e114c9c3 100644
@@ -12469,7 +12469,7 @@ NXP FXAS21002C DRIVER
 M:	Rui Miguel Silva <[email protected]>
 L:	[email protected]
 S:	Maintained
-F:	Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.txt
+F:	Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml
 F:	drivers/iio/gyro/fxas21002c.h
 F:	drivers/iio/gyro/fxas21002c_core.c
 F:	drivers/iio/gyro/fxas21002c_i2c.c
Signature · 1 line
2.28.0
#1 lore raw
Quoted 4 lines · On Tue, 13 Oct 2020 14:15:45 +0100 Rui Miguel Silva <[email protected]>…

Convert fxas21002c gyroscope sensor bindings documentation to yaml schema and remove the textual bindings document.

Hi Rui,

Always good to see a yaml conversion.

Comments inline...

Quoted 51 lines
---
 .../bindings/iio/gyroscope/nxp,fxas21002c.txt | 31 --------
 .../iio/gyroscope/nxp,fxas21002c.yaml         | 77 +++++++++++++++++++
 MAINTAINERS                                   |  2 +-
 3 files changed, 78 insertions(+), 32 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.txt
 create mode 100644 Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.txt deleted +0 -31
deleted file mode 100644
index 465e104bbf14..000000000000
@@ -1,31 +0,0 @@
-* NXP FXAS21002C Gyroscope device tree bindings
-
-http://www.nxp.com/products/sensors/gyroscopes/3-axis-digital-gyroscope:FXAS21002C
-
-Required properties:
-  - compatible : should be "nxp,fxas21002c"
-  - reg : the I2C address of the sensor or SPI chip select number for the
-          device.
-  - vdd-supply: phandle to the regulator that provides power to the sensor.
-  - vddio-supply: phandle to the regulator that provides power to the bus.
-
-Optional properties:
-  - reset-gpios : gpio used to reset the device, see gpio/gpio.txt
-  - interrupts : device support 2 interrupts, INT1 and INT2,
-                 the interrupts can be triggered on rising or falling edges.
-                 See interrupt-controller/interrupts.txt
-  - interrupt-names: should contain "INT1" or "INT2", the gyroscope interrupt
-                     line in use.
-  - drive-open-drain: the interrupt/data ready line will be configured
-                      as open drain, which is useful if several sensors share
-                      the same interrupt line. This is a boolean property.
-                      (This binding is taken from pinctrl/pinctrl-bindings.txt)
-
-Example:
-
-gyroscope@20 {
-	compatible = "nxp,fxas21002c";
-	reg = <0x20>;
-	vdd-supply = <&reg_peri_3p15v>;
-	vddio-supply = <&reg_peri_3p15v>;
-};
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +0 -0
new file mode 100644
index 000000000000..7680e97cf1d9

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml line 7

Quoted 7 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +7 -0
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/gyroscope/nxp,fxas21002c.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP FXAS21002C Gyroscope Unit

Why Unit? Gyroscope seems fine to me.

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml line 13

Quoted 6 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +6 -0
+
+maintainers:
+  - Rui Miguel Silva <[email protected]>
+
+description: |
+  3 axis digital gyroscope device with an I2C and SPI interface.

Can we document the SPI binding as well? With an example.

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml line 19

Quoted 6 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +6 -0
+  http://www.nxp.com/products/sensors/gyroscopes/3-axis-digital-gyroscope:FXAS21002C
+
+properties:
+  compatible:
+    enum:
+      - nxp,fxas21002c

Unless we think it likely this binding is going to shortly include other options,

       const: nxp... 

(doesn't matter that much though!)

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml line 23

Quoted 4 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +4 -0
+
+  reg:
+    maxItems: 1
+    description: base address of the device

No it isn't. It is the i2c address. Also this is standard so no description needed.

Quoted 5 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +5 -0
+
+  vdd-supply:
+    description: Regulator that provides power to the sensor
+
+  vddio-supply:

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml

Quoted 10 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +10 -0
+    description: Regulator that provides power to the bus
+
+  reset-gpios:
+    maxItems: 1
+    description: GPIO connected to reset
+
+  interrupts:
+    minItems: 1
+    maxItems: 2
+    description: device support 2 interrupts,

I'd argue that's obvious from the maxItems. So no need to repeat it.

INT1 and INT2,
This part is clear form interrupt-names so again, I wouldn't say it again.

the interrupts can

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml line 39

Quoted 1 line
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +1 -0
+                 be triggered on rising or falling edges.

This last bit is useful so I would have just this or something like

Either interrupt may be triggered on rising or falling edges.

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml line 48

Quoted 9 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +9 -0
+
+  interrupt-names:
+    minItems: 1
+    maxItems: 2
+    items:
+      enum:
+        - INT1
+        - INT2
+    description: gyroscope interrupt line in use.

Singular with 2 interrupts. Personally I'd just drop the description as not adding anything.

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml line 59

Quoted 11 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +11 -0
+
+  drive-open-drain:
+    type: boolean
+    description: the interrupt/data ready line will be configured as open drain,
+                 which is useful if several sensors share the same interrupt
+                 line.
+
+required:
+  - compatible
+  - reg
+  - vdd-supply

Why required? If it's hard wired on will a stub regulator not work fine with this device. Do we need to read it's voltage or similar?

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml line 62

Quoted 3 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +3 -0
+  - vddio-supply
+
+unevaluatedProperties: false

Why unevalutatedProperties rather than additionalProperties? I'll confess I don't really understand when to use unevaluatedProperties. I'm guessing issue here is we don't have the SPI bindings stuff?

Quoted 28 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +15 -0
+
+examples:
+  - |
+    i2c0 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        gyroscope@20 {
+          compatible = "nxp,fxas21002c";
+          reg = <0x20>;
+
+          vdd-supply = <&reg_peri_3p15v>;
+          vddio-supply = <&reg_peri_3p15v>;
+        };
+    };
MAINTAINERS +1 -1
index 6594f0966716..2e85e114c9c3 100644
@@ -12469,7 +12469,7 @@ NXP FXAS21002C DRIVER
 M:	Rui Miguel Silva <[email protected]>
 L:	[email protected]
 S:	Maintained
-F:	Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.txt
+F:	Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml
 F:	drivers/iio/gyro/fxas21002c.h
 F:	drivers/iio/gyro/fxas21002c_core.c
 F:	drivers/iio/gyro/fxas21002c_i2c.c
#2 lore raw

Hi Jonathan,

Quoted 6 lines · Jonathan Cameron
Quoted 3 lines · On Tue, 13 Oct 2020 14:15:45 +0100 Rui Miguel Silva <[email protected]>…

Convert fxas21002c gyroscope sensor bindings documentation to yaml schema and remove the textual bindings document.

Quoted 7 lines
Quoted 1 line

Hi Rui,

Always good to see a yaml conversion.

Comments inline...

Thanks for the review, I will address all your comments, just a small note bellow regarding the unevaluatedProperties.

Quoted 145 lines
Quoted 52 lines
---
 .../bindings/iio/gyroscope/nxp,fxas21002c.txt | 31 --------
 .../iio/gyroscope/nxp,fxas21002c.yaml         | 77 +++++++++++++++++++
 MAINTAINERS                                   |  2 +-
 3 files changed, 78 insertions(+), 32 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.txt
 create mode 100644 Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.txt deleted +0 -31
deleted file mode 100644
index 465e104bbf14..000000000000
@@ -1,31 +0,0 @@
-* NXP FXAS21002C Gyroscope device tree bindings
-
-http://www.nxp.com/products/sensors/gyroscopes/3-axis-digital-gyroscope:FXAS21002C
-
-Required properties:
-  - compatible : should be "nxp,fxas21002c"
-  - reg : the I2C address of the sensor or SPI chip select number for the
-          device.
-  - vdd-supply: phandle to the regulator that provides power to the sensor.
-  - vddio-supply: phandle to the regulator that provides power to the bus.
-
-Optional properties:
-  - reset-gpios : gpio used to reset the device, see gpio/gpio.txt
-  - interrupts : device support 2 interrupts, INT1 and INT2,
-                 the interrupts can be triggered on rising or falling edges.
-                 See interrupt-controller/interrupts.txt
-  - interrupt-names: should contain "INT1" or "INT2", the gyroscope interrupt
-                     line in use.
-  - drive-open-drain: the interrupt/data ready line will be configured
-                      as open drain, which is useful if several sensors share
-                      the same interrupt line. This is a boolean property.
-                      (This binding is taken from pinctrl/pinctrl-bindings.txt)
-
-Example:
-
-gyroscope@20 {
-	compatible = "nxp,fxas21002c";
-	reg = <0x20>;
-	vdd-supply = <&reg_peri_3p15v>;
-	vddio-supply = <&reg_peri_3p15v>;
-};
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +0 -0
new file mode 100644
index 000000000000..7680e97cf1d9

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml line 7

Quoted 7 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +7 -0
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/gyroscope/nxp,fxas21002c.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP FXAS21002C Gyroscope Unit

Why Unit? Gyroscope seems fine to me.

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml line 13

Quoted 6 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +6 -0
+
+maintainers:
+  - Rui Miguel Silva <[email protected]>
+
+description: |
+  3 axis digital gyroscope device with an I2C and SPI interface.

Can we document the SPI binding as well? With an example.

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml line 19

Quoted 6 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +6 -0
+  http://www.nxp.com/products/sensors/gyroscopes/3-axis-digital-gyroscope:FXAS21002C
+
+properties:
+  compatible:
+    enum:
+      - nxp,fxas21002c

Unless we think it likely this binding is going to shortly include other options,

       const: nxp... 

(doesn't matter that much though!)

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml line 23

Quoted 4 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +4 -0
+
+  reg:
+    maxItems: 1
+    description: base address of the device

No it isn't. It is the i2c address. Also this is standard so no description needed.

Quoted 5 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +5 -0
+
+  vdd-supply:
+    description: Regulator that provides power to the sensor
+
+  vddio-supply:

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml

Quoted 10 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +10 -0
+    description: Regulator that provides power to the bus
+
+  reset-gpios:
+    maxItems: 1
+    description: GPIO connected to reset
+
+  interrupts:
+    minItems: 1
+    maxItems: 2
+    description: device support 2 interrupts,

I'd argue that's obvious from the maxItems. So no need to repeat it.

INT1 and INT2,
This part is clear form interrupt-names so again, I wouldn't say it again.

the interrupts can

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml line 39

Quoted 1 line
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +1 -0
+                 be triggered on rising or falling edges.

This last bit is useful so I would have just this or something like

Either interrupt may be triggered on rising or falling edges.

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml line 48

Quoted 9 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +9 -0
+
+  interrupt-names:
+    minItems: 1
+    maxItems: 2
+    items:
+      enum:
+        - INT1
+        - INT2
+    description: gyroscope interrupt line in use.

Singular with 2 interrupts. Personally I'd just drop the description as not adding anything.

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml line 59

Quoted 11 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +11 -0
+
+  drive-open-drain:
+    type: boolean
+    description: the interrupt/data ready line will be configured as open drain,
+                 which is useful if several sensors share the same interrupt
+                 line.
+
+required:
+  - compatible
+  - reg
+  - vdd-supply

Why required? If it's hard wired on will a stub regulator not work fine with this device. Do we need to read it's voltage or similar?

Quoted 6 lines

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml line 62

Quoted 3 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +3 -0
+  - vddio-supply
+
+unevaluatedProperties: false

Why unevalutatedProperties rather than additionalProperties? I'll confess I don't really understand when to use unevaluatedProperties.

Yeah, it is not very clear also to me, I was just following this clean up series from Rob, and from my understanding here is a case for unevaluatedProperties. But maybe I got it all wrong.

Cheers,
Rui

Quoted 31 lines

I'm guessing issue here is we don't have the SPI bindings stuff?

Quoted 28 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +15 -0
+
+examples:
+  - |
+    i2c0 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        gyroscope@20 {
+          compatible = "nxp,fxas21002c";
+          reg = <0x20>;
+
+          vdd-supply = <&reg_peri_3p15v>;
+          vddio-supply = <&reg_peri_3p15v>;
+        };
+    };
MAINTAINERS +1 -1
index 6594f0966716..2e85e114c9c3 100644
@@ -12469,7 +12469,7 @@ NXP FXAS21002C DRIVER
 M:	Rui Miguel Silva <[email protected]>
 L:	[email protected]
 S:	Maintained
-F:	Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.txt
+F:	Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml
 F:	drivers/iio/gyro/fxas21002c.h
 F:	drivers/iio/gyro/fxas21002c_core.c
 F:	drivers/iio/gyro/fxas21002c_i2c.c
maintainer
#3 lore raw

Hi Jonathan,
forgot the link bellow...

Quoted 171 lines · Rui Miguel Silva

Hi Jonathan,

Quoted 6 lines · Jonathan Cameron
Quoted 3 lines · On Tue, 13 Oct 2020 14:15:45 +0100 Rui Miguel Silva <[email protected]>…

Convert fxas21002c gyroscope sensor bindings documentation to yaml schema and remove the textual bindings document.

Quoted 7 lines
Quoted 1 line

Hi Rui,

Always good to see a yaml conversion.

Comments inline...

Thanks for the review, I will address all your comments, just a small note bellow regarding the unevaluatedProperties.

Quoted 145 lines
Quoted 52 lines
---
 .../bindings/iio/gyroscope/nxp,fxas21002c.txt | 31 --------
 .../iio/gyroscope/nxp,fxas21002c.yaml         | 77 +++++++++++++++++++
 MAINTAINERS                                   |  2 +-
 3 files changed, 78 insertions(+), 32 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.txt
 create mode 100644 Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.txt deleted +0 -31
deleted file mode 100644
index 465e104bbf14..000000000000
@@ -1,31 +0,0 @@
-* NXP FXAS21002C Gyroscope device tree bindings
-
-http://www.nxp.com/products/sensors/gyroscopes/3-axis-digital-gyroscope:FXAS21002C
-
-Required properties:
-  - compatible : should be "nxp,fxas21002c"
-  - reg : the I2C address of the sensor or SPI chip select number for the
-          device.
-  - vdd-supply: phandle to the regulator that provides power to the sensor.
-  - vddio-supply: phandle to the regulator that provides power to the bus.
-
-Optional properties:
-  - reset-gpios : gpio used to reset the device, see gpio/gpio.txt
-  - interrupts : device support 2 interrupts, INT1 and INT2,
-                 the interrupts can be triggered on rising or falling edges.
-                 See interrupt-controller/interrupts.txt
-  - interrupt-names: should contain "INT1" or "INT2", the gyroscope interrupt
-                     line in use.
-  - drive-open-drain: the interrupt/data ready line will be configured
-                      as open drain, which is useful if several sensors share
-                      the same interrupt line. This is a boolean property.
-                      (This binding is taken from pinctrl/pinctrl-bindings.txt)
-
-Example:
-
-gyroscope@20 {
-	compatible = "nxp,fxas21002c";
-	reg = <0x20>;
-	vdd-supply = <&reg_peri_3p15v>;
-	vddio-supply = <&reg_peri_3p15v>;
-};
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +0 -0
new file mode 100644
index 000000000000..7680e97cf1d9

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml line 7

Quoted 7 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +7 -0
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/gyroscope/nxp,fxas21002c.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP FXAS21002C Gyroscope Unit

Why Unit? Gyroscope seems fine to me.

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml line 13

Quoted 6 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +6 -0
+
+maintainers:
+  - Rui Miguel Silva <[email protected]>
+
+description: |
+  3 axis digital gyroscope device with an I2C and SPI interface.

Can we document the SPI binding as well? With an example.

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml line 19

Quoted 6 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +6 -0
+  http://www.nxp.com/products/sensors/gyroscopes/3-axis-digital-gyroscope:FXAS21002C
+
+properties:
+  compatible:
+    enum:
+      - nxp,fxas21002c

Unless we think it likely this binding is going to shortly include other options,

       const: nxp... 

(doesn't matter that much though!)

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml line 23

Quoted 4 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +4 -0
+
+  reg:
+    maxItems: 1
+    description: base address of the device

No it isn't. It is the i2c address. Also this is standard so no description needed.

Quoted 5 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +5 -0
+
+  vdd-supply:
+    description: Regulator that provides power to the sensor
+
+  vddio-supply:

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml

Quoted 10 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +10 -0
+    description: Regulator that provides power to the bus
+
+  reset-gpios:
+    maxItems: 1
+    description: GPIO connected to reset
+
+  interrupts:
+    minItems: 1
+    maxItems: 2
+    description: device support 2 interrupts,

I'd argue that's obvious from the maxItems. So no need to repeat it.

INT1 and INT2,
This part is clear form interrupt-names so again, I wouldn't say it again.

the interrupts can

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml line 39

Quoted 1 line
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +1 -0
+                 be triggered on rising or falling edges.

This last bit is useful so I would have just this or something like

Either interrupt may be triggered on rising or falling edges.

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml line 48

Quoted 9 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +9 -0
+
+  interrupt-names:
+    minItems: 1
+    maxItems: 2
+    items:
+      enum:
+        - INT1
+        - INT2
+    description: gyroscope interrupt line in use.

Singular with 2 interrupts. Personally I'd just drop the description as not adding anything.

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml line 59

Quoted 11 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +11 -0
+
+  drive-open-drain:
+    type: boolean
+    description: the interrupt/data ready line will be configured as open drain,
+                 which is useful if several sensors share the same interrupt
+                 line.
+
+required:
+  - compatible
+  - reg
+  - vdd-supply

Why required? If it's hard wired on will a stub regulator not work fine with this device. Do we need to read it's voltage or similar?

Quoted 6 lines

Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml line 62

Quoted 3 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +3 -0
+  - vddio-supply
+
+unevaluatedProperties: false

Why unevalutatedProperties rather than additionalProperties? I'll confess I don't really understand when to use unevaluatedProperties.

Quoted 2 lines

Yeah, it is not very clear also to me, I was just following this clean up series from Rob, and from my understanding here is a case for

here is the missing link to the clean up series:
https://lkml.kernel.org/lkml/[email protected]/T/

Cheers,
Rui

Quoted 36 lines

unevaluatedProperties. But maybe I got it all wrong.

Cheers,
Rui

Quoted 31 lines

I'm guessing issue here is we don't have the SPI bindings stuff?

Quoted 28 lines
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml new file +15 -0
+
+examples:
+  - |
+    i2c0 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        gyroscope@20 {
+          compatible = "nxp,fxas21002c";
+          reg = <0x20>;
+
+          vdd-supply = <&reg_peri_3p15v>;
+          vddio-supply = <&reg_peri_3p15v>;
+        };
+    };
MAINTAINERS +1 -1
index 6594f0966716..2e85e114c9c3 100644
@@ -12469,7 +12469,7 @@ NXP FXAS21002C DRIVER
 M:	Rui Miguel Silva <[email protected]>
 L:	[email protected]
 S:	Maintained
-F:	Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.txt
+F:	Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml
 F:	drivers/iio/gyro/fxas21002c.h
 F:	drivers/iio/gyro/fxas21002c_core.c
 F:	drivers/iio/gyro/fxas21002c_i2c.c