< Home

PlayStation 1/2 joypads via SPI interface Driver for Linux

May 22, 2017

I wrote PlayStation 1/2 joypads via SPI interface Driver for Linux.
(for Enbedded Linux board has SPI, Raspberry Pi, Beagle, Panda, 96board, Armadillo, etc)
It is installed in Linux kernel 4.12.


How to use Raspberry Pi

To use this driver to Raspbian, You must recompile a Raspbian kernel. (RetroPie too)
To recompile kernel, see KERNEL BUILDING

And need this patch files

In kernel recomple, you get Raspbian kernel source, then use patch.

$ patch -p1 -d linux < psxpad-spi_rp.patch

This patch is include:

(In few days, you'll need DT change and kernel config only.) (:D)


Then menuconfig, enable driver.

$ cd linux
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
[Device Drivers] -> [Input device support] -> [Joysticks/Gamepads] ->
<M> PlayStation 1/2 joypads via SPI interface
[*] PlayStation 1/2 joypads force feedback (rumble) support
and [Save], and [Exit].

If you can recompile Raspbian kernel, install to SD card.


Then connect PSX(PS1/2) pad wire to Raspberry Pi, upper figure.
To connect pad jack pin(thick), you can use dupon(QI) connector.
(I made 4-ways special multi tap device ...)


(Appendix) Raspberry Pi's SPI bus have two CS.
Other than Attention pin, wire is common. 2nd pad's Attention wire to GPIO7 SPI0_CS1_N.


Thanks to guidance and fixies from Dmitry Torokhov.
And Thanks to pointing out from Linux kernel mailing list members too.


PSX pads test program. not need kernel rebuild. spidev_psxpad.tar.xz