From patchwork Mon Oct 24 16:26:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_Za=C5=A5ovi=C4=8D?= X-Patchwork-Id: 10221 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp642787wru; Mon, 24 Oct 2022 13:39:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM49IYzXGUIGLHMXdkB/4d0eG85hoR6fOdBNBMBn4wayhkadqoU4rh6ASX3bN4IWhzzxI+tB X-Received: by 2002:a63:de0e:0:b0:46f:23c6:e7d9 with SMTP id f14-20020a63de0e000000b0046f23c6e7d9mr2515209pgg.68.1666643974831; Mon, 24 Oct 2022 13:39:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666643974; cv=none; d=google.com; s=arc-20160816; b=RqwR3d4chdsQHYRBMqeoXyHcvpaDg1rOATeLJq98BCXNQnJUpiv/4TWo5OL37zOV8A hL1/Q6OQYYYZPvnEFQNrMzbpj+UeTfqLoyOdYcmxaOhJXWrr6Dv1XjeaCeLncrJ6oGyD ELjmWmv+IDHio7B7f0F/fUnrXEYlqkws9M256KH1YqMzzPhdrfMM/2pbJpS5oC41hyVC RHw6Tn+MNCcvrYbS8S0sVj4ORxhCrIgF+IOo8VccUgfOXOedYU8LDMWqCVeaGP06bm0G pNJmEpI4kw9w8MUnOBTX5zJNwj5RpZoVDDt3CAJfJkOMo/SDlPRQBsXaagyXTmSVJzOn EJFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cMhauQ4bglHHby0SI3Wa9kpbiclzAulw2G0WqIC6ZJg=; b=1C1+7fzq9aJPoj+2jNbzZIPmFPsZeM1L7AmKN4w3QEl0hSbRYV9Vhp+/1NCXlP2DBR YNqWU4sfiwHfvgNy5wrG3rhFeOkXV4lKVGg/bhX2LFRNdibmPJT6WJXSOXGy0xALbpPW itWqXX6ZNYezJ18/9HFnPqAbK9gNyLcOfqx4GNaiAHXDQpDJtp57YL9B/0YGpj0hgaff c8Mhrjriani5/pbPKNDowUv+PYRfbe6HrcIoGuIgGalrGvjGMoA8eXACa7IIDUKVszBK YS829huyzl3ztepISeia9xJV/7s/4R0TVgUiaNn48jDU4dwBORkiWe7GQEbEFH3ysA0e /0QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="oOjW/jF0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p13-20020a17090a2c4d00b00203a40da02csi976501pjm.45.2022.10.24.13.39.21; Mon, 24 Oct 2022 13:39:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="oOjW/jF0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232101AbiJXUdg (ORCPT + 99 others); Mon, 24 Oct 2022 16:33:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234300AbiJXUdA (ORCPT ); Mon, 24 Oct 2022 16:33:00 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61B83BD067; Mon, 24 Oct 2022 11:44:01 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id a5so19969014edb.11; Mon, 24 Oct 2022 11:44:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cMhauQ4bglHHby0SI3Wa9kpbiclzAulw2G0WqIC6ZJg=; b=oOjW/jF0tJQRyAPO73lcAdZ7584mvc8a+XSN1eaIB9n65olANlWLKuyHhINXtYyOlw qaApKoPDe0P8FiofGuu520o9u8twm2fYktwx8GDid1PEIHiCXuZvRMUNY9SQPaZOVlKB +hoT8I5CGXfnnX1gR3lU7jCO5Jz/lImft94/4yemyaZkEZxQ+uNteYrmxaT4tYSZDyCT XUozIx7F5qlHfiYie4fMMQequjqOZiPB8//jDyIFoM/6VhNfewxBvxqP3jftYkHB4CHM EmUeDjgWN/TZDXuGjBt+aosjgrLKgGXVeMxiNwov1XBlQNpUwzo4LfRBlis1nXAOy/cP jLIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cMhauQ4bglHHby0SI3Wa9kpbiclzAulw2G0WqIC6ZJg=; b=HvqylfYAUiIysKxBZ6IJhs5/D7WmTDiPsTN3iDuwSTnANXD/aZsfKbSMH8qp4xYxqB xzslIS6/RtBFqfBJQQX0N9f1jHU4z+geMLCVJj91tC0lg/p56YPD2o0otdemkoVyuRP1 5CKezkfZuSc/4GgkeeiLoRIkBLXQNiHpM7dwFSe92TDJzinjQ4zTHDQiiwhJvGn12xU2 u+RDl7hXF+2FRrXuU80inIGGWqfv5RpN5Zn+/1C8qpSdxKa+rKng76nu9JyiaichGthS TuUP03u4sk8Lzuio1zKjG2XJGr+iB/4PtwUUY5Bl5CtWOWp5N/k33P+qCwrXaWMx68C8 3oog== X-Gm-Message-State: ACrzQf1JwGAqo6TacAWgIQu5Oja5ncG4Parts6WiFGIN2AW+m+iwuYcg w69vme8NSwuXIag0Sw4bBtJGeOa0XKc1tw== X-Received: by 2002:a05:6402:3789:b0:461:3ae6:8d73 with SMTP id et9-20020a056402378900b004613ae68d73mr18572013edb.229.1666628821059; Mon, 24 Oct 2022 09:27:01 -0700 (PDT) Received: from 1974459598.wifi.kn.vutbr.cz (nat-kn.net.vutbr.cz. [147.229.117.40]) by smtp.gmail.com with ESMTPSA id b14-20020a1709064d4e00b0078dd4c89781sm108186ejv.35.2022.10.24.09.27.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Oct 2022 09:27:00 -0700 (PDT) From: =?utf-8?q?Martin_Za=C5=A5ovi=C4=8D?= To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, andersson@kernel.org, jeffrey.l.hugo@gmail.com, Michael.Srba@seznam.cz, gregkh@linuxfoundation.org, elder@linaro.org, hemantk@codeaurora.org, mani@kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linus.walleij@linaro.org Cc: =?utf-8?q?Martin_Za=C5=A5ovi=C4=8D?= Subject: [RFCv3 PATCH 1/2] dt-bindings: bus: add Wiegand bus dt documentation Date: Mon, 24 Oct 2022 18:26:49 +0200 Message-Id: <20221024162650.36587-2-m.zatovic1@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221024162650.36587-1-m.zatovic1@gmail.com> References: <20221024162650.36587-1-m.zatovic1@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747602872802518543?= X-GMAIL-MSGID: =?utf-8?q?1747602872802518543?= This patch documents the devicetree entry for a Wiegand bus. A Wiegand bus follows the Wiegand protocol. The bus claims two GPIO lines over which the communication is realized. It also introduces parameters to control the pulse durations and the length of a gap after finishing sending a frame. Signed-off-by: Martin Zaťovič --- .../devicetree/bindings/bus/wiegand.yaml | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 Documentation/devicetree/bindings/bus/wiegand.yaml -- 2.37.3 diff --git a/Documentation/devicetree/bindings/bus/wiegand.yaml b/Documentation/devicetree/bindings/bus/wiegand.yaml new file mode 100644 index 000000000000..cc8d3c46bcde --- /dev/null +++ b/Documentation/devicetree/bindings/bus/wiegand.yaml @@ -0,0 +1,75 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/bus/wiegand.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Wiegand Bus + +maintainers: + - Martin Zaťovič + +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. + +properties: + $nodename: + pattern: "^wiegand(@.*|-[0-9a-f])*$" + + compatible: + contains: + const: wiegand + + data-hi-gpios: + description: GPIO spec for data-hi line to use. This line is initially + pulled up to high value. Wiegand write of a bit of value 1 results in + this line being pulled down for pulse length duration. + maxItems: 1 + + data-lo-gpios: + description: GPIO spec for data-lo line to use. This line is initially + pulled up to high value. Wiegand write of a bit of value 0 results in + this line being pulled down for pulse length duration. + maxItems: 1 + + pulse-len: + description: length of the low pulse for both data-lo and data-hi lines. + maxItems: 1 + + interval-len: + description: length of a whole bit (both the pulse and the high phase) for + both data-hi and data-lo lines in usecs; defaults to 2000us. + maxItems: 1 + + frame-gap: + description: length of the last bit of a frame (both the pulse and the high + phase) in usec; defaults to 2000us. + maxItems: 1 + +required: + - compatible + - data-hi-gpios + - data-lo-gpios + +additionalProperties: false + +examples: + - | + #include + + wiegand { + compatible = "wiegand"; + data-hi-gpios = <&gpio 7 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + data-lo-gpios = <&gpio 6 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + pulse-len = <100>; + interval-len = <2500>; + frame-gap = <4000>; + }; + +...