[RFCv2 PATCH 3/4] dt-bindings: gpio: add Wiegand GPIO driver dt documentation

From: Martin Zaťovič
Date: Wed Oct 05 2022 - 10:58:56 EST


The Wiegand GPIO driver uses two GPIO lines to transmit data -
data-hi and data-lo. These lines need to be defined in the
devicetree, otherwise the driver will not probe successfully.

Signed-off-by: Martin Zaťovič <m.zatovic1@xxxxxxxxx>
---
.../bindings/gpio/gpio-wiegand.yaml | 53 +++++++++++++++++++
1 file changed, 53 insertions(+)
create mode 100644 Documentation/devicetree/bindings/gpio/gpio-wiegand.yaml

diff --git a/Documentation/devicetree/bindings/gpio/gpio-wiegand.yaml b/Documentation/devicetree/bindings/gpio/gpio-wiegand.yaml
new file mode 100644
index 000000000000..3b235667ae17
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-wiegand.yaml
@@ -0,0 +1,53 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/gpio/gpio-wiegand.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Wiegand GPIO controller
+
+description: |
+ Wiegand GPIO controller running under Wiegand bus.
+
+maintainers:
+ - Martin Zaťovič <m.zatovic1@xxxxxxxxx>
+
+properties:
+ $nodename:
+ pattern: "^wiegand-gpio@[0-9a-f]+$"
+
+ compatible:
+ const: wiegand,wiegand-gpio
+
+ data-hi-gpios:
+ description: GPIO spec for data-hi line to use
+ maxItems: 1
+
+ data-lo-gpios:
+ description: GPIO spec for data-lo line to use
+ maxItems: 1
+
+required:
+ - compatible
+ - data-hi-gpios
+ - data-lo-gpios
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+
+ wiegand {
+ compatible = "wiegand";
+
+ wiegand-gpio {
+ compatible = "wiegand,wiegand-gpio";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_uart2_wiegand>;
+ data-hi-gpios = <&gpio2 7 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+ data-lo-gpios = <&gpio2 6 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+ };
+ };
+
+...
--
2.37.3