linux: device_supply: Prioritize Gaming Input

The DualSense and DualShock 4 have 3 main components: the gamepad proper,
a touchpad and motion sensors. They also have an extra component in the
form of a headphone jack, which is only available via BT on the
PlayStation consoles but can be used on other devices via USB.

Commit 00eb31a63c increased the priority of
Gaming Input so the controllers weren't accidentally identified as only
the Touchpad, which works on BT. This commit prioritizes Gaming Input over
Audio Device, fixing an issue that only happens on USB.

Resolves: #296
This commit is contained in:
Mateus Rodrigues Costa 2025-01-03 11:15:30 -03:00 committed by Kate Hsuan
parent a16c752e85
commit 351affe12f

View file

@ -354,16 +354,16 @@ up_device_supply_sibling_discovered_guess_type (UpDevice *device,
* a keyboard, a touchpad, and... etc, for example Sony DualShock4 joystick.
* A mouse and a touchpad may include a mouse and a keyboard.
* Therefore, the priority is:
* 1. Audio
* 2. Gaming_input
* 1. Gaming_input
* 2. Audio
* 3. Keyboard
* 4. Tablet
* 5. Touchpad
* 6. Mouse
*/
UpDeviceKind priority[] = {
UP_DEVICE_KIND_OTHER_AUDIO,
UP_DEVICE_KIND_GAMING_INPUT,
UP_DEVICE_KIND_OTHER_AUDIO,
UP_DEVICE_KIND_KEYBOARD,
UP_DEVICE_KIND_TABLET,
UP_DEVICE_KIND_TOUCHPAD,