From: "Martin Zaťovič" <m.zatovic1@gmail.com>
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: "Martin Zaťovič" <m.zatovic1@gmail.com>
Subject: [RFCv3 PATCH 0/2] Wiegand bus driver
Date: Mon, 24 Oct 2022 18:26:48 +0200 [thread overview]
Message-ID: <20221024162650.36587-1-m.zatovic1@gmail.com> (raw)
Thank you for all your suggestions and points.
I have realized that I have approached implementing the Wiegand bus
driver wrong. I have used the words 'GPIO controller', which made it
seem like there was a GPIO controller for which another driver would
be needed. What I meant to implement is a simple bit-banged Wiegand
bus driver.
There is no GPIO controller, instead the two GPIO lines are
controlled by the bus. They are utilized to send messages following
the Wiegand protocol and the bus driver should implement such
bit-banging. Now only a single devicetree entry is needed instead
of two as in the previous version - thanks to Krzysztof for
pointing it out.
The driver was based on similar drivers in the drivers/bus directory.
There is also an abstract API in include/linux/wiegand.h that
contains functions to write to the bus or set a particular format.
This API is meant to be used in drivers of devices communicating
using Wiegand protocol.
The user can write on the bus using a device file or change
the format and message payload length via sysfs files.
The driver was tested on NXP Verdin iMX8MP Plus.
With regards,
Martin Zaťovič
v1->v2:
Split the driver into a bus driver a gpio driver and an abstract API.
Fix issues pointed out in RFC
v2->v3:
Discard the bus driver. Implement new bus driver based on the gpio
driver(the gpio driver was actually implementing the functionality
of the bus).
Fix make dt_bindings_check errors.
Use devicetree properties for pulse_len, interval_len and frame_gap
attributes.
Martin Zaťovič (2):
dt-bindings: bus: add Wiegand bus dt documentation
bus: add bit banged Wiegand bus driver
Documentation/ABI/testing/sysfs-bus-wiegand | 20 +
.../devicetree/bindings/bus/wiegand.yaml | 75 +++
MAINTAINERS | 8 +
drivers/bus/Kconfig | 7 +
drivers/bus/Makefile | 1 +
drivers/bus/wiegand.c | 509 ++++++++++++++++++
include/linux/wiegand.h | 58 ++
7 files changed, 678 insertions(+)
create mode 100644 Documentation/ABI/testing/sysfs-bus-wiegand
create mode 100644 Documentation/devicetree/bindings/bus/wiegand.yaml
create mode 100644 drivers/bus/wiegand.c
create mode 100644 include/linux/wiegand.h
--
2.37.3
next reply other threads:[~2022-10-24 18:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-24 16:26 Martin Zaťovič [this message]
2022-10-24 16:26 ` [RFCv3 PATCH 1/2] dt-bindings: bus: add Wiegand bus dt documentation Martin Zaťovič
2022-10-24 21:12 ` Krzysztof Kozlowski
2022-10-24 16:26 ` [RFCv3 PATCH 2/2] bus: add bit banged Wiegand bus driver Martin Zaťovič
2022-10-24 21:21 ` Krzysztof Kozlowski
2022-10-25 5:38 ` Christophe JAILLET
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=20221024162650.36587-1-m.zatovic1@gmail.com \
--to=m.zatovic1@gmail.com \
--cc=Michael.Srba@seznam.cz \
--cc=andersson@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=elder@linaro.org \
--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 \
/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
all inboxes | Powered by JetHome®