From: "Martin Zaťovič" <m.zatovic1@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: devicetree@vger.kernel.org, mani@kernel.org,
hemantk@codeaurora.org, elder@linaro.org, f.fainelli@gmail.com,
linus.walleij@linaro.org, Michael.Srba@seznam.cz,
jeffrey.l.hugo@gmail.com, gregkh@linuxfoundation.org,
bjorn.andersson@linaro.org, saravanak@google.com,
krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org,
"Martin Zaťovič" <m.zatovic1@gmail.com>
Subject: [PATCH RFC v1 2/2] devicetree: bindings: bus: add Wiegand driver documentation
Date: Thu, 28 Jul 2022 11:17:12 +0200 [thread overview]
Message-ID: <20220728091712.13395-2-m.zatovic1@gmail.com> (raw)
In-Reply-To: <20220728091712.13395-1-m.zatovic1@gmail.com>
Wiegand write-only driver requires definitions of two GPIO lines
in the devicetree. This adds the documentation of their
definitions.
Signed-off-by: Martin Zaťovič <m.zatovic1@gmail.com>
---
.../devicetree/bindings/bus/wiegand-gpio.yaml | 66 +++++++++++++++++++
MAINTAINERS | 1 +
2 files changed, 67 insertions(+)
create mode 100644 Documentation/devicetree/bindings/bus/wiegand-gpio.yaml
diff --git a/Documentation/devicetree/bindings/bus/wiegand-gpio.yaml b/Documentation/devicetree/bindings/bus/wiegand-gpio.yaml
new file mode 100644
index 000000000000..74733aadc61e
--- /dev/null
+++ b/Documentation/devicetree/bindings/bus/wiegand-gpio.yaml
@@ -0,0 +1,66 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/bus/wiegand-gpio.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Wiegand write-only GPIO driver
+
+maintainers:
+ - Martin Zaťovič <m.zatovic1@gmail.com>
+
+description: |
+ Wiegand interface is a wiring standard popularized in the 1980s. To this day
+ many card readers, fingerprint readers, sensors, etc. use Wiegand interface
+ particularly for access control applications. It utilizes two wires to
+ transmit the data - D0 and D1.
+
+ Both data lines are initially pulled up. To send a bit of value 1, the D1
+ line is set low. Similarly to send a bit of value 0, the D0 line is set low.
+ Standard Wiegand formats include 26, 36 and 37 bit and they reserve the first
+ and last bits for parity. The first(MSB) parity bit is set to 1 if the parity
+ of the first half of the payload is odd. The last(LSB) parity bit is set to 1
+ if the parity of the second half of the payload even.
+
+properties:
+ $nodename:
+ pattern: "^wiegand-gpio(@[0-9a-f]+)?$"
+
+ compatible:
+ contains:
+ const: gpio,wiegand-gpio
+ description:
+ Shall contain "wiegand-gpio" for the driver to match with this node.
+
+ wiegand-data-hi-gpios:
+ description:
+ gpio used to transmit bits the value of which is 1, it should be
+ flagged as active high with GPIO_ACTIVE_HIGH from
+ <dt-bindings/gpio/gpio.h>.
+ maxItems: 1
+
+ wiegand-data-lo-gpios:
+ description:
+ gpio used to transmit bits the value of which is 1, it should be
+ flagged as active high with GPIO_ACTIVE_HIGH from
+ <dt-bindings/gpio/gpio.h>.
+ maxItems: 1
+
+required:
+ - compatible
+ - wiegand-data-hi-gpios
+ - wiegand-data-lo-gpios
+
+additionalProperties: true
+
+examples:
+ - |
+ wiegand-gpio {
+ compatible = "wiegand-gpio";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_uart1_wiegand>;
+ wiegand-data-hi-gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>;
+ wiegand-data-lo-gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>;
+ status = "okay";
+ };
diff --git a/MAINTAINERS b/MAINTAINERS
index 9a519530e44e..c7db1e41cc02 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -21589,6 +21589,7 @@ F: drivers/rtc/rtc-sd3078.c
WIEGAND WRITE-ONLY GPIO DRIVER
M: Martin Zaťovič <m.zatovic1@gmail.com>
S: Maintained
+F: Documentation/devicetree/bindings/bus/wiegand-gpio.yaml
F: drivers/bus/wiegand-gpio.c
F: drivers/bus/wiegand-gpio.h
--
2.37.1
next prev parent reply other threads:[~2022-07-28 9:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-28 9:17 [PATCH RFC v1 1/2] bus: add Wiegand write-only GPIO driver Martin Zaťovič
2022-07-28 9:17 ` Martin Zaťovič [this message]
2022-07-28 10:15 ` [PATCH RFC v1 2/2] devicetree: bindings: bus: add Wiegand driver documentation Krzysztof Kozlowski
2022-07-28 13:47 ` Rob Herring
2022-07-28 16:43 ` Krzysztof Kozlowski
2022-08-22 7:21 ` Linus Walleij
2022-07-28 9:56 ` [PATCH RFC v1 1/2] bus: add Wiegand write-only GPIO driver Greg KH
2022-07-28 10:05 ` Greg KH
2022-07-28 10:32 ` Krzysztof Kozlowski
2022-08-22 7:14 ` Linus Walleij
[not found] ` <CAPGNi94R6bW80Yc=B5iesW=ihxy_bD1p-iPhLCASh_=82mjT9w@mail.gmail.com>
2022-09-20 9:44 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220728091712.13395-2-m.zatovic1@gmail.com \
--to=m.zatovic1@gmail.com \
--cc=Michael.Srba@seznam.cz \
--cc=bjorn.andersson@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=elder@linaro.org \
--cc=f.fainelli@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=hemantk@codeaurora.org \
--cc=jeffrey.l.hugo@gmail.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mani@kernel.org \
--cc=robh+dt@kernel.org \
--cc=saravanak@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).