[PATCH v2 1/2] dt-bindings: improve wb,mbl-gpio binding documentation.

Niall Leonard via B4 Submission Endpoint
2023-01-31T13:49:55Z

From: Niall Leonard <nl250060@ncr.com>

Convert existing wd,mbl-gpio binding documentation to YAML and add
new optional propery "no-input".

Signed-off-by: Niall Leonard <nl250060@ncr.com>
---
.../devicetree/bindings/gpio/wd,mbl-gpio.txt | 38 -----------
.../devicetree/bindings/gpio/wd,mbl-gpio.yaml | 78 ++++++++++++++++++++++
2 files changed, 78 insertions(+), 38 deletions(-)

diff --git a/Documentation/devicetree/bindings/gpio/wd,mbl-gpio.txt b/Documentation/devicetree/bindings/gpio/wd,mbl-gpio.txt
deleted file mode 100644
index 038c3a6a1f4d..000000000000
--- a/Documentation/devicetree/bindings/gpio/wd,mbl-gpio.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-Bindings for the Western Digital's MyBook Live memory-mapped GPIO controllers.
-
-The Western Digital MyBook Live has two memory-mapped GPIO controllers.
-Both GPIO controller only have a single 8-bit data register, where GPIO
-state can be read and/or written.
-
-Required properties:
- - compatible: should be "wd,mbl-gpio"
- - reg-names: must contain
- "dat" - data register
- - reg: address + size pairs describing the GPIO register sets;
- order must correspond with the order of entries in reg-names
- - #gpio-cells: must be set to 2. The first cell is the pin number and
- the second cell is used to specify the gpio polarity:
- 0 = active high
- 1 = active low
- - gpio-controller: Marks the device node as a gpio controller.
-
-Optional properties:
- - no-output: GPIOs are read-only.
-
-Examples:
- gpio0: gpio0@e0000000 {
- compatible = "wd,mbl-gpio";
- reg-names = "dat";
- reg = <0xe0000000 0x1>;
- #gpio-cells = <2>;
- gpio-controller;
- };
-
- gpio1: gpio1@e0100000 {
- compatible = "wd,mbl-gpio";
- reg-names = "dat";
- reg = <0xe0100000 0x1>;
- #gpio-cells = <2>;
- gpio-controller;
- no-output;
- };
diff --git a/Documentation/devicetree/bindings/gpio/wd,mbl-gpio.yaml b/Documentation/devicetree/bindings/gpio/wd,mbl-gpio.yaml
new file mode 100644
index 000000000000..d1c72a42c5bc
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/wd,mbl-gpio.yaml
@@ -0,0 +1,78 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/gpio/wd,mbl-gpio.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Western Digital's MyBook Live memory-mapped GPIO controllers.
+
+maintainers:
+ - Niall Leonard <nl250060@ncr.com>
+
+description: |+
+ Bindings for the Western Digital's MyBook Live memory-mapped GPIO controllers.
+
+ The Western Digital MyBook Live has two memory-mapped GPIO controllers.
+ Both GPIO controller only have a single 8-bit data register, where GPIO
+ state can be read and/or written.
+
+properties:
+ compatible:
+ enum:
+ - wd,mbl-gpio
+
+ reg-names:
+ items:
+ - const: dat
+
+ reg:
+ maxItems: 1
+
+ "#gpio-cells":
+ const: 2
+
+ gpio-controller: true
+
+ no-output:
+ description: GPIOs are read-only.
+
+ no-input:
+ description: GPIOs are write-only.
+
+required:
+ - compatible
+ - reg-names
+ - reg
+ - '#gpio-cells'
+ - gpio-controller
+
+additionalProperties: false
+
+examples:
+ - |
+ gpio0: gpio0@e0000000 {
+ compatible = "wd,mbl-gpio";
+ reg-names = "dat";
+ reg = <0xe0000000 0x1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ };
+
+ gpio1: gpio1@e0100000 {
+ compatible = "wd,mbl-gpio";
+ reg-names = "dat";
+ reg = <0xe0100000 0x1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ no-output;
+ };
+
+ gpio2: gpio1@e0200000 {
+ compatible = "wd,mbl-gpio";
+ reg-names = "dat";
+ reg = <0xe0200000 0x1>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ no-input;
+ };
+

--
2.34.1