diff mbox series

[v1,2/2] Staging: silabs si4455 serial driver: docs device tree binding

Message ID 20201210122154.GA31799@dincontrollerdev
State New
Headers show
Series [v1,1/2] Staging: silabs si4455 serial driver: fix directory structure and coding style | expand

Commit Message

József Horváth Dec. 10, 2020, 12:21 p.m. UTC
add: device tree binding schema

Signed-off-by: József Horváth <info@ministro.hu>
---
 .../bindings/serial/silabs,si4455.yaml        | 53 +++++++++++++++++++
 MAINTAINERS                                   |  2 +-
 2 files changed, 54 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/serial/silabs,si4455.yaml

Comments

Rob Herring Dec. 11, 2020, 3:01 a.m. UTC | #1
On Thu, Dec 10, 2020 at 12:21:56PM +0000, József Horváth wrote:
> add: device tree binding schema

For the subject, follow conventions of the directory. Something like:

dt-bindings: serial: Add SiLabs SI4455 schema

> Signed-off-by: József Horváth <info@ministro.hu>
> ---
>  .../bindings/serial/silabs,si4455.yaml        | 53 +++++++++++++++++++
>  MAINTAINERS                                   |  2 +-
>  2 files changed, 54 insertions(+), 1 deletion(-)
>  create mode 100644 Documentation/devicetree/bindings/serial/silabs,si4455.yaml
> 
> diff --git a/Documentation/devicetree/bindings/serial/silabs,si4455.yaml b/Documentation/devicetree/bindings/serial/silabs,si4455.yaml
> new file mode 100644
> index 000000000000..80a73a61755b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/serial/silabs,si4455.yaml
> @@ -0,0 +1,53 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: "http://devicetree.org/schemas/serial/silabs,si4455.yaml#"
> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> +
> +title: Silicon Labs Si4455 device tree bindings

Add 'description' with some info on this h/w and possibly a link to 
datasheet if available.

> +
> +maintainers:
> +  - József Horváth <info@ministro.hu>
> +
> +allOf:
> +  - $ref: "/schemas/serial.yaml#"
> +
> +properties:
> +  compatible:
> +    const: silabs,si4455
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  spi-max-frequency:
> +    description: maximum clock frequency on SPI port
> +    maximum: 500000
> +
> +  shutdown-gpios:
> +    description: gpio pin for SDN
> +    maxItems: 1
> +
> +required:
> +  - reg
> +  - interrupts
> +  - spi-max-frequency
> +  - shutdown-gpios
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    &spi0 {
> +      serial0: si4455@0 {
> +        compatible = "silabs,si4455";
> +        reg = <0>;
> +        interrupt-parent = <&gpio>;
> +        interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
> +        shutdown-gpios = <&gpio 26 1>;
> +        spi-max-frequency = <300000>;
> +      };
> +    };
> +...
> diff --git a/MAINTAINERS b/MAINTAINERS
> index a29bc17d446d..16cc96971ac2 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -15937,7 +15937,7 @@ F:	drivers/platform/x86/touchscreen_dmi.c
>  SILICON LABS SI4455 SERIAL DRIVER
>  M:	József Horváth <info@ministro.hu>
>  S:	Maintained
> -F:	Documentation/devicetree/bindings/staging/serial/silabs,si4455.txt

This is a new file, right?

> +F:	Documentation/devicetree/bindings/serial/silabs,si4455.yaml
>  F:	drivers/tty/serial/si4455.c
>  F:	drivers/tty/serial/si4455_api.h
>  
> -- 
> 2.17.1
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/serial/silabs,si4455.yaml b/Documentation/devicetree/bindings/serial/silabs,si4455.yaml
new file mode 100644
index 000000000000..80a73a61755b
--- /dev/null
+++ b/Documentation/devicetree/bindings/serial/silabs,si4455.yaml
@@ -0,0 +1,53 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/serial/silabs,si4455.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Silicon Labs Si4455 device tree bindings
+
+maintainers:
+  - József Horváth <info@ministro.hu>
+
+allOf:
+  - $ref: "/schemas/serial.yaml#"
+
+properties:
+  compatible:
+    const: silabs,si4455
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  spi-max-frequency:
+    description: maximum clock frequency on SPI port
+    maximum: 500000
+
+  shutdown-gpios:
+    description: gpio pin for SDN
+    maxItems: 1
+
+required:
+  - reg
+  - interrupts
+  - spi-max-frequency
+  - shutdown-gpios
+
+additionalProperties: false
+
+examples:
+  - |
+    &spi0 {
+      serial0: si4455@0 {
+        compatible = "silabs,si4455";
+        reg = <0>;
+        interrupt-parent = <&gpio>;
+        interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
+        shutdown-gpios = <&gpio 26 1>;
+        spi-max-frequency = <300000>;
+      };
+    };
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index a29bc17d446d..16cc96971ac2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -15937,7 +15937,7 @@  F:	drivers/platform/x86/touchscreen_dmi.c
 SILICON LABS SI4455 SERIAL DRIVER
 M:	József Horváth <info@ministro.hu>
 S:	Maintained
-F:	Documentation/devicetree/bindings/staging/serial/silabs,si4455.txt
+F:	Documentation/devicetree/bindings/serial/silabs,si4455.yaml
 F:	drivers/tty/serial/si4455.c
 F:	drivers/tty/serial/si4455_api.h