diff mbox series

[12/54] dt-bindings: gnss: Convert UBlox Neo-6M binding to a schema

Message ID 20210721140424.725744-13-maxime@cerno.tech (mailing list archive)
State New, archived
Headers show
Series ARM: dts: Last round of DT schema fixes | expand

Commit Message

Maxime Ripard July 21, 2021, 2:03 p.m. UTC
The UBlox Neo 6M is supported by Linux thanks to its device tree
binding.

Now that we have the DT validation in place, let's convert the device
tree bindings for that driver over to a YAML schema.

Cc: Johan Hovold <johan@kernel.org>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 .../bindings/gnss/u-blox,neo-6m.yaml          | 62 +++++++++++++++++++
 .../devicetree/bindings/gnss/u-blox.txt       | 45 --------------
 2 files changed, 62 insertions(+), 45 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml
 delete mode 100644 Documentation/devicetree/bindings/gnss/u-blox.txt

Comments

Rob Herring July 23, 2021, 9:42 p.m. UTC | #1
On Wed, Jul 21, 2021 at 04:03:42PM +0200, Maxime Ripard wrote:
> The UBlox Neo 6M is supported by Linux thanks to its device tree
> binding.
> 
> Now that we have the DT validation in place, let's convert the device
> tree bindings for that driver over to a YAML schema.
> 
> Cc: Johan Hovold <johan@kernel.org>
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> ---
>  .../bindings/gnss/u-blox,neo-6m.yaml          | 62 +++++++++++++++++++
>  .../devicetree/bindings/gnss/u-blox.txt       | 45 --------------
>  2 files changed, 62 insertions(+), 45 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml
>  delete mode 100644 Documentation/devicetree/bindings/gnss/u-blox.txt
> 
> diff --git a/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml b/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml
> new file mode 100644
> index 000000000000..45b886ae0f45
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml
> @@ -0,0 +1,62 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/gnss/u-blox,neo-6m.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: U-blox GNSS Receiver Device Tree Bindings
> +
> +maintainers:
> +  - Johan Hovold <johan@kernel.org>
> +
> +description: >
> +  The U-blox GNSS receivers can use UART, DDC (I2C), SPI and USB interfaces.
> +
> +properties:
> +  compatible:
> +    enum:
> +      - u-blox,neo-6m
> +      - u-blox,neo-8
> +      - u-blox,neo-m8
> +
> +  reg:
> +    description: >
> +      The DDC Slave Address, SPI chip select address, the number of the USB hub
> +      port or the USB host-controller port to wich this device is attached,

s/wich/which/

> +      depending on the bus used. Required for the DDC, SPI or USB busses.
> +
> +  vcc-supply:
> +    description: >
> +      Main voltage regulator
> +
> +  timepulse-gpios:
> +    maxItems: 1
> +    description: >
> +      Time pulse GPIO
> +
> +  u-blox,extint-gpios:
> +    maxItems: 1
> +    description: >
> +      GPIO connected to the "external interrupt" input pin
> +  
> +  v-bckp-supply:
> +    description: >
> +      Backup voltage regulator
> +
> +  current-speed: true
> +
> +required:
> +  - compatible
> +  - vcc-supply
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    uart {

serial {

> +        gnss {
> +            compatible = "u-blox,neo-8";
> +            v-bckp-supply = <&gnss_v_bckp_reg>;
> +            vcc-supply = <&gnss_vcc_reg>;
> +        };
> +    };
> diff --git a/Documentation/devicetree/bindings/gnss/u-blox.txt b/Documentation/devicetree/bindings/gnss/u-blox.txt
> deleted file mode 100644
> index 7cdefd058fe0..000000000000
> --- a/Documentation/devicetree/bindings/gnss/u-blox.txt
> +++ /dev/null
> @@ -1,45 +0,0 @@
> -u-blox GNSS Receiver DT binding
> -
> -The u-blox GNSS receivers can use UART, DDC (I2C), SPI and USB interfaces.
> -
> -Please see Documentation/devicetree/bindings/gnss/gnss.txt for generic
> -properties.
> -
> -Required properties:
> -
> -- compatible	: Must be one of
> -
> -			"u-blox,neo-6m"
> -			"u-blox,neo-8"
> -			"u-blox,neo-m8"
> -
> -- vcc-supply	: Main voltage regulator
> -
> -Required properties (DDC):
> -- reg		: DDC (I2C) slave address
> -
> -Required properties (SPI):
> -- reg		: SPI chip select address
> -
> -Required properties (USB):
> -- reg		: Number of the USB hub port or the USB host-controller port
> -                  to which this device is attached
> -
> -Optional properties:
> -
> -- timepulse-gpios	: Time pulse GPIO
> -- u-blox,extint-gpios	: GPIO connected to the "external interrupt" input pin
> -- v-bckp-supply	: Backup voltage regulator
> -
> -Example:
> -
> -serial@1234 {
> -	compatible = "ns16550a";
> -
> -	gnss {
> -		compatible = "u-blox,neo-8";
> -
> -		v-bckp-supply = <&gnss_v_bckp_reg>;
> -		vcc-supply = <&gnss_vcc_reg>;
> -	};
> -};
> -- 
> 2.31.1
> 
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml b/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml
new file mode 100644
index 000000000000..45b886ae0f45
--- /dev/null
+++ b/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml
@@ -0,0 +1,62 @@ 
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/gnss/u-blox,neo-6m.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: U-blox GNSS Receiver Device Tree Bindings
+
+maintainers:
+  - Johan Hovold <johan@kernel.org>
+
+description: >
+  The U-blox GNSS receivers can use UART, DDC (I2C), SPI and USB interfaces.
+
+properties:
+  compatible:
+    enum:
+      - u-blox,neo-6m
+      - u-blox,neo-8
+      - u-blox,neo-m8
+
+  reg:
+    description: >
+      The DDC Slave Address, SPI chip select address, the number of the USB hub
+      port or the USB host-controller port to wich this device is attached,
+      depending on the bus used. Required for the DDC, SPI or USB busses.
+
+  vcc-supply:
+    description: >
+      Main voltage regulator
+
+  timepulse-gpios:
+    maxItems: 1
+    description: >
+      Time pulse GPIO
+
+  u-blox,extint-gpios:
+    maxItems: 1
+    description: >
+      GPIO connected to the "external interrupt" input pin
+  
+  v-bckp-supply:
+    description: >
+      Backup voltage regulator
+
+  current-speed: true
+
+required:
+  - compatible
+  - vcc-supply
+
+additionalProperties: false
+
+examples:
+  - |
+    uart {
+        gnss {
+            compatible = "u-blox,neo-8";
+            v-bckp-supply = <&gnss_v_bckp_reg>;
+            vcc-supply = <&gnss_vcc_reg>;
+        };
+    };
diff --git a/Documentation/devicetree/bindings/gnss/u-blox.txt b/Documentation/devicetree/bindings/gnss/u-blox.txt
deleted file mode 100644
index 7cdefd058fe0..000000000000
--- a/Documentation/devicetree/bindings/gnss/u-blox.txt
+++ /dev/null
@@ -1,45 +0,0 @@ 
-u-blox GNSS Receiver DT binding
-
-The u-blox GNSS receivers can use UART, DDC (I2C), SPI and USB interfaces.
-
-Please see Documentation/devicetree/bindings/gnss/gnss.txt for generic
-properties.
-
-Required properties:
-
-- compatible	: Must be one of
-
-			"u-blox,neo-6m"
-			"u-blox,neo-8"
-			"u-blox,neo-m8"
-
-- vcc-supply	: Main voltage regulator
-
-Required properties (DDC):
-- reg		: DDC (I2C) slave address
-
-Required properties (SPI):
-- reg		: SPI chip select address
-
-Required properties (USB):
-- reg		: Number of the USB hub port or the USB host-controller port
-                  to which this device is attached
-
-Optional properties:
-
-- timepulse-gpios	: Time pulse GPIO
-- u-blox,extint-gpios	: GPIO connected to the "external interrupt" input pin
-- v-bckp-supply	: Backup voltage regulator
-
-Example:
-
-serial@1234 {
-	compatible = "ns16550a";
-
-	gnss {
-		compatible = "u-blox,neo-8";
-
-		v-bckp-supply = <&gnss_v_bckp_reg>;
-		vcc-supply = <&gnss_vcc_reg>;
-	};
-};