Commit 9ee0a055 authored by Danilo Krummrich's avatar Danilo Krummrich Committed by Dmitry Torokhov

Input: PS/2 gpio bit banging driver for serio bus

This driver provides PS/2 serio bus support by implementing bit banging
with the GPIO API. The GPIO pins, data and clock, can be configured with
a node in the device tree or by generic device properties (GDP).

Writing to a device is supported as well, though it is possible timings
can not be halt as they are tough and difficult to reach with bit banging.
Therefore it can be configured (also in DT and GDP) whether the serio
write function should be available for clients.

This driver is for development purposes and not recommended for productive
use. However, this driver can be useful e.g. when no USB port is available
or using old peripherals is desired as PS/2 controller chips getting rare.

This driver was tested on bcm2825 and on Kirin 960 and it worked well
together with the atkbd and psmouse driver.
Signed-off-by: default avatarDanilo Krummrich <danilokrummrich@dk-develop.de>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Acked-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 0ca06810
Device-Tree binding for ps/2 gpio device
Required properties:
- compatible = "ps2-gpio"
- data-gpios: the data pin
- clk-gpios: the clock pin
- interrupts: Should trigger on the falling edge of the clock line.
Optional properties:
- write-enable: Indicates whether write function is provided
to serio device. Possibly providing the write fn will not work, because
of the tough timing requirements.
Example nodes:
ps2@0 {
compatible = "ps2-gpio";
interrupt-parent = <&gpio>;
interrupts = <23 IRQ_TYPE_EDGE_FALLING>;
data-gpios = <&gpio 24 GPIO_ACTIVE_HIGH>;
clk-gpios = <&gpio 23 GPIO_ACTIVE_HIGH>;
write-enable;
};
......@@ -84,6 +84,11 @@ hardware descriptions such as device tree or ACPI:
NAND flash MTD subsystem and provides chip access and partition parsing like
any other NAND driving hardware.
- ps2-gpio: drivers/input/serio/ps2-gpio.c is used to drive a PS/2 (IBM) serio
bus, data and clock line, by bit banging two GPIO lines. It will appear as
any other serio bus to the system and makes it possible to connect drivers
for e.g. keyboards and other PS/2 protocol based devices.
Apart from this there are special GPIO drivers in subsystems like MMC/SD to
read card detect and write protect GPIO lines, and in the TTY serial subsystem
to emulate MCTRL (modem control) signals CTS/RTS by using two GPIO lines. The
......
......@@ -292,6 +292,17 @@ config SERIO_SUN4I_PS2
To compile this driver as a module, choose M here: the
module will be called sun4i-ps2.
config SERIO_GPIO_PS2
tristate "GPIO PS/2 bit banging driver"
depends on GPIOLIB
help
Say Y here if you want PS/2 bit banging support via GPIO.
To compile this driver as a module, choose M here: the
module will be called ps2-gpio.
If you are unsure, say N.
config USERIO
tristate "User space serio port driver support"
help
......
......@@ -30,4 +30,5 @@ obj-$(CONFIG_SERIO_APBPS2) += apbps2.o
obj-$(CONFIG_SERIO_OLPC_APSP) += olpc_apsp.o
obj-$(CONFIG_HYPERV_KEYBOARD) += hyperv-keyboard.o
obj-$(CONFIG_SERIO_SUN4I_PS2) += sun4i-ps2.o
obj-$(CONFIG_SERIO_GPIO_PS2) += ps2-gpio.o
obj-$(CONFIG_USERIO) += userio.o
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment