A simple kernel module that allows connecting a PS/2 keyboard using GPIO (one input for data and one for clock).
This can be used e.g. to connect and old PS/2 keyboard to a Raspberry PI or a similar SBC and thus save one USB port.
The implementation is a bit quick-and-dirty so you probably shouldn't use it in production.
Your kernel should contain KEYBOARD_ATKBD
, SERIO_PCIPS2
, SERIO_LIBPS2
and
SERIO_APBPS2
. (I'm not sure If only some subset is not enough)
Standard Raspbian kernel don't have this parts. You can build your own kernel following this manual: https://www.raspberrypi.com/documentation/computers/linux_kernel.html and enable this parts of kernel in config.
make
make install
Create module configuration file modprobe.d/linux-gpio-ps2.conf
(fill your pin numbers in GPIO/BCM pin numbering):
options gpio-ps2-serio gpio_clk=17
options gpio-ps2-serio gpio_data=27
Load the module automatically:
echo gpio-ps2-serio > modules-load.d/gpio-ps2.conf
Then reboot.