summaryrefslogtreecommitdiff
path: root/drivers/hid
diff options
context:
space:
mode:
authorBenjamin Tissoires <bentiss@kernel.org>2024-09-13 16:26:35 +0300
committerBenjamin Tissoires <bentiss@kernel.org>2024-09-13 16:26:35 +0300
commit54ab9273529d24e36f0490c8acf00c1e50d09278 (patch)
tree991d6f6c26293e819026ec906df06a5270142947 /drivers/hid
parentfe9c6249e810818fe67bfeaf9319a40eb0bdae03 (diff)
parent2933aa8b77be957d57d1a1ba71617e09cdaa2cbb (diff)
downloadlinux-54ab9273529d24e36f0490c8acf00c1e50d09278.tar.xz
Merge branch 'for-6.12/hid-playstation' into for-linus
- Enhance compatibility with clone controllers (Max Staudt)
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-playstation.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/hid/hid-playstation.c b/drivers/hid/hid-playstation.c
index e7c309cfe3a0..0d90d7ee693c 100644
--- a/drivers/hid/hid-playstation.c
+++ b/drivers/hid/hid-playstation.c
@@ -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;