--The driver is by default, so enable it with make menuconfig! --The patch has a bug, so fix it manually!
GIGAZINE had an article that looked interesting.
Sony officially provides Linux driver for PS5 DualSense
https://gigazine.net/news/20201226-sony-ps5-dualsense-linux-driver/
I applied all the above patches to Linux 5.10.2, which is the latest version at the time of writing the article on my Ubuntu 20.10, and executed the "bindeb-pkg" command to build the kernel, and the build succeeded. However, the kernel module of "hid-playstation" was not created and the driver could not be used.
Cheeks! !! Let's verify it. However, I don't have a PS5, so I checked if it could be compiled.
The Kernel is the same 5.10.2, and the working environment is ubuntu 20.10.
$ wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.10.2.tar.xz
$ tar xxvf linux*.tar.xz
$ cd linux*
$ mkdir build
$ cp /boot/config-`uname -r` build/.config
etc. Let's refer to https://gihyo.jp/admin/serial/01/ubuntu-recipe/0526?page=2
for this area.
https://patchwork.kernel.org/project/linux-input/list/?series=404369
Download the patches (diffs) one by one from here and apply them with great care ...
The default is OFF, so let's enable this.
> Device Drivers > HID support > Special HID drivers
Here, you have to enable it as shown below.
<M> PlayStation HID Driver
[*] PlayStation force feedback support
Well, I compiled it, but I get an error.
make[1]:directory'/home/kmtr/linux/build'Enter
SYNC include/config/auto.conf.cmd
GEN Makefile
GEN Makefile
DESCEND objtool
CALL /home/kmtr/linux/linux-5.10.2/scripts/atomic/check-atomics.sh
CALL /home/kmtr/linux/linux-5.10.2/scripts/checksyscalls.sh
CHK include/generated/compile.h
CHK kernel/kheaders_data.tar.xz
GEN kernel/kheaders_data.tar.xz
CC [M] kernel/kheaders.o
CC [M] drivers/leds/led-class-multicolor.o
CC [M] drivers/hid/hid-core.o
CC [M] drivers/hid/hid-input.o
CC [M] drivers/hid/hid-quirks.o
/home/kmtr/linux/linux-5.10.2/drivers/hid/hid-quirks.c:567:3: error: expected expression before ‘{’ token
567 | + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS5_CONTROLLER) },
| ^
make[3]: *** [/home/kmtr/linux/linux-5.10.2/scripts/Makefile.build:279: drivers/hid/hid-quirks.o]Error 1
make[3]: ***Waiting for an incomplete job....
make[2]: *** [/home/kmtr/linux/linux-5.10.2/scripts/Makefile.build:496: drivers/hid]Error 2
make[2]: ***Waiting for an incomplete job....
make[1]: *** [/home/kmtr/linux/linux-5.10.2/Makefile:1805: drivers]Error 2
make[1]: ***Waiting for an incomplete job....
make[1]:directory'/home/kmtr/linux/build'Get out of
Hmmm, isn't it wrong here? "+" Is an obstacle.
https://patchwork.kernel.org/project/linux-input/patch/[email protected]/
07-13-HID-playstation-add-DualSense-Bluetooth-support..diff
diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c
index 1ca46cb445be..541c8837debd 100644
--- a/drivers/hid/hid-quirks.c
+++ b/drivers/hid/hid-quirks.c
@@ -567,6 +567,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
#endif
#if IS_ENABLED(CONFIG_HID_PLAYSTATION)
{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS5_CONTROLLER) },
++ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS5_CONTROLLER) },
#endif
#if IS_ENABLED(CONFIG_HID_PRIMAX)
{ HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) },
With this,
#if IS_ENABLED(CONFIG_HID_PLAYSTATION)
{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS5_CONTROLLER) },
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS5_CONTROLLER) },
#endif
Will result in a compile error. So you need to remove the "+" after applying the patch.
#if IS_ENABLED(CONFIG_HID_PLAYSTATION)
{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS5_CONTROLLER) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS5_CONTROLLER) },
#endif
If you make it again with this, you have successfully created hid-playstation.o!
CC [M] drivers/hid/hid-samsung.o
CC [M] drivers/hid/hid-sjoy.o
CC [M] drivers/hid/hid-sony.o
CC [M] drivers/hid/hid-speedlink.o
CC [M] drivers/hid/hid-steam.o
<Omitted>
CC [M] drivers/hid/usbhid/usbmouse.o
CC [M] drivers/hid/hid-playstation.o
LD [M] drivers/hid/hid.o
LD [M] drivers/hid/hid-logitech.o
LD [M] drivers/hid/hid-picolcd.o
The necessary ko is ready! However, I can't check the operation because there is nothing! !!
kmtr@ubuntu2010:~/linux/build$ find . -name "*.ko" | grep play
./drivers/usb/misc/appledisplay.ko
./drivers/usb/typec/altmodes/typec_displayport.ko
./drivers/media/rc/keymaps/rc-wetek-play2.ko
./drivers/hid/hid-playstation.ko
--The driver is by default, so enable it with make menuconfig! --The patch has a bug, so fix it manually!