Skip to content

Commit 54ab927

Browse files
author
Benjamin Tissoires
committed
Merge branch 'for-6.12/hid-playstation' into for-linus
- Enhance compatibility with clone controllers (Max Staudt)
2 parents fe9c624 + 2933aa8 commit 54ab927

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

drivers/hid/hid-playstation.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2143,6 +2143,26 @@ static void dualshock4_output_worker(struct work_struct *work)
21432143

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

2146+
/*
2147+
* Some 3rd party gamepads expect updates to rumble and lightbar
2148+
* together, and setting one may cancel the other.
2149+
*
2150+
* Let's maximise compatibility by always sending rumble and lightbar
2151+
* updates together, even when only one has been scheduled, resulting
2152+
* in:
2153+
*
2154+
* ds4->valid_flag0 >= 0x03
2155+
*
2156+
* Hopefully this will maximise compatibility with third-party pads.
2157+
*
2158+
* Any further update bits, such as 0x04 for lightbar blinking, will
2159+
* be or'd on top of this like before.
2160+
*/
2161+
if (ds4->update_rumble || ds4->update_lightbar) {
2162+
ds4->update_rumble = true; /* 0x01 */
2163+
ds4->update_lightbar = true; /* 0x02 */
2164+
}
2165+
21462166
if (ds4->update_rumble) {
21472167
/* Select classic rumble style haptics and enable it. */
21482168
common->valid_flag0 |= DS4_OUTPUT_VALID_FLAG0_MOTOR;

0 commit comments

Comments
 (0)