
Well here’s a pleasant Christmas surprise … Sony has released a new “hid-playstation” Linux kernel driver for the release of the PlayStation 5 DualSense controller and will also be used to support other PlayStation hardware on Linux .
This new Linux kernel driver supports the PlayStation 5 “DualSense” game controller in both USB and Bluetooth mode. All major functions along with LEDs, motion sensors, touchpad, battery, light bar and rumble are all supported by this official Sony Linux driver.
The Linux kernel already has the existing “hid-sony” driver, while this PlayStation 5 game controller comes with the hid-playstation driver. With the announcement of the new driver, they plan to move some of Sony Interactive Entertainment’s hardware support from the existing hid-sony to hid-playstation drivers. The hid-sony driver will be maintained and used by wider Sony devices. This new driver follows the move about a year ago from Sony “officially” maintaining the hid-sony Linux input driver.
The Linux driver exposes DualSense functionality as a ‘composite device’ similar to DualShock 4 in hid-sony, spread across multiple frameworks. First, it exposes 3 evdev nodes for the ‘gamepad’, ‘touchpad’ and ‘motion sensors’ respectively. The FF framework is used to provide basic rumble functions. The LEDs class is used to implement the Player indicator LEDs under the touchpad of the DualSense, while the new ‘LEDs-class-multicolor’ is used for the light bars next to the touchpad.
Not yet supported are new unique features introduced by the DualSense, such as Adaptive Triggers and the VCM based Haptics. These functions require a large amount of data and complex data structures. It is not clear how these should be exposed. The current frameworks of Evdev and FF are too restrictive. We hope to have a dialogue on how to uncover these in a generic way over time.
This new driver comes in with just over 1,400 lines of code in its native form for the PS5 controller. When moving from older hardware support to this new driver, there’s also a promise of unit testing coverage and more.
The new HID PlayStation driver is currently under review and is not yet in the queue for mainlining, but those who want to try it can find the 13 patches to test.
Separately, SDL 2.0.14 was also released this week with initial map support for the PlayStation 5 controller buttons for that library widely used by cross-platform games.