Skip to content

Commit

Permalink
Merge branch 'for-6.12/hid-playstation' into for-linus
Browse files Browse the repository at this point in the history
- Enhance compatibility with clone controllers (Max Staudt)
  • Loading branch information
Benjamin Tissoires committed Sep 13, 2024
2 parents fe9c624 + 2933aa8 commit 54ab927
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions drivers/hid/hid-playstation.c
Original file line number Diff line number Diff line change
Expand Up @@ -2143,6 +2143,26 @@ static void dualshock4_output_worker(struct work_struct *work)

spin_lock_irqsave(&ds4->base.lock, flags);

/*
* Some 3rd party gamepads expect updates to rumble and lightbar
* together, and setting one may cancel the other.
*
* Let's maximise compatibility by always sending rumble and lightbar
* updates together, even when only one has been scheduled, resulting
* in:
*
* ds4->valid_flag0 >= 0x03
*
* Hopefully this will maximise compatibility with third-party pads.
*
* Any further update bits, such as 0x04 for lightbar blinking, will
* be or'd on top of this like before.
*/
if (ds4->update_rumble || ds4->update_lightbar) {
ds4->update_rumble = true; /* 0x01 */
ds4->update_lightbar = true; /* 0x02 */
}

if (ds4->update_rumble) {
/* Select classic rumble style haptics and enable it. */
common->valid_flag0 |= DS4_OUTPUT_VALID_FLAG0_MOTOR;
Expand Down

0 comments on commit 54ab927

Please sign in to comment.