Skip to content

Commit

Permalink
wiegand: add Wiegand bus driver
Browse files Browse the repository at this point in the history
Add a bus driver for Wiegand protocol. The bus driver handles
Wiegand controller and Wiegand device managemement and driver
matching. The bus driver defines the structures for Wiegand
controllers and Wiegand devices.

Wiegand controller structure represents a master and contains
attributes such as the payload_len for configuring the size
of a single Wiegand message in bits. It also stores the
controller attributes defined in the devicetree.

Each Wiegand controller should be associated with one Wiegand
device, as Wiegand is typically a point-to-point bus.

Signed-off-by: Martin Zaťovič <m.zatovic1@gmail.com>
  • Loading branch information
macegrace authored and intel-lab-lkp committed Feb 2, 2023
1 parent 92c66b2 commit 5dc4c22
Show file tree
Hide file tree
Showing 7 changed files with 746 additions and 0 deletions.
2 changes: 2 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -22432,6 +22432,8 @@ WIEGAND BUS DRIVER
M: Martin Zaťovič <m.zatovic1@gmail.com>
S: Maintained
F: Documentation/devicetree/bindings/wiegand/wiegand-controller.yaml
F: drivers/wiegand/wiegand.c
F: include/linux/wiegand.h

WILOCITY WIL6210 WIRELESS DRIVER
L: linux-wireless@vger.kernel.org
Expand Down
2 changes: 2 additions & 0 deletions drivers/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ source "drivers/spi/Kconfig"

source "drivers/spmi/Kconfig"

source "drivers/wiegand/Kconfig"

source "drivers/hsi/Kconfig"

source "drivers/pps/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions drivers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ obj-$(CONFIG_VHOST_RING) += vhost/
obj-$(CONFIG_VHOST_IOTLB) += vhost/
obj-$(CONFIG_VHOST) += vhost/
obj-$(CONFIG_VLYNQ) += vlynq/
obj-$(CONFIG_WIEGAND) += wiegand/
obj-$(CONFIG_GREYBUS) += greybus/
obj-$(CONFIG_COMEDI) += comedi/
obj-$(CONFIG_STAGING) += staging/
Expand Down
20 changes: 20 additions & 0 deletions drivers/wiegand/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
config WIEGAND
tristate "Wiegand Bus driver"
help
The "Wiegand Interface" is an asynchronous low-level protocol
or wiring standard. It is typically used for point-to-point
communication. The data length of Wiegand messages is not defined,
so the devices usually default to 26, 36 or 37 bits per message.
The throughput of Wiegand depends on the selected pulse length and
the intervals between pulses, in comparison to other busses it
is generally rather slow.

Despite its higher age, Wiegand remains widely used in access
control systems to connect a card swipe mechanism. Such mechanisms
utilize the Wiegand effect to transfer data from the card to
the reader.

Wiegand uses two wires to transmit the data D0 and D1. Both lines
are initially pulled up. When a bit of value 0 is being transmitted,
the D0 line is pulled down. Similarly, when a bit of value 1 is being
transmitted, the D1 line is pulled down.
1 change: 1 addition & 0 deletions drivers/wiegand/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
obj-$(CONFIG_WIEGAND) += wiegand.o
Loading

0 comments on commit 5dc4c22

Please sign in to comment.