Kernel/LibInput: Rework Joystick handling

Joystick axis and buttons are now named to standard values, this allows
interfacing multiple different controllers (only DS3 is supported)

Add ioctl calls for userspace to set joystick player leds and rumble

Only use DS3 code paths when we detect that the attached device is
actually an DS3 controller

update test-joystick program to the new interface and add support to
control rumble and player leds
This commit is contained in:
2026-01-07 19:01:07 +02:00
parent a5318448f5
commit 24d91eee90
5 changed files with 359 additions and 63 deletions

View File

@@ -54,9 +54,14 @@ struct winsize
#define SND_GET_SAMPLE_RATE 61 /* stores sample rate to uint32_t argument */
#define SND_RESET_BUFFER 62 /* stores the size of internal buffer to uint32_t argument and clears the buffer */
#define SND_GET_BUFFERSZ 63 /* stores the size of internal buffer to uint32_t argument */
#define SND_GET_TOTAL_PINS 64 /* gets the number of pins on the current device */
#define SND_GET_PIN 65 /* gets the currently active pin */
#define SND_SET_PIN 66 /* sets the currently active pin */
#define SND_GET_TOTAL_PINS 64 /* gets the number of pins on the current device as uint32_t */
#define SND_GET_PIN 65 /* gets the currently active pin as uint32_t */
#define SND_SET_PIN 66 /* sets the currently active pin to uint32_t */
#define JOYSTICK_GET_LEDS 80 /* get controller led bitmap to uint8_t argument */
#define JOYSTICK_SET_LEDS 81 /* set controller leds to uint8_t bitmap */
#define JOYSTICK_GET_RUMBLE 82 /* get controller rumble strength to uint8_t argument */
#define JOYSTICK_SET_RUMBLE 83 /* set controller rumble strength to uint8_t argument */
int ioctl(int, int, ...);