Skip to content

Commit f5308d1

Browse files
cgutmandtor
authored andcommitted
Input: xpad - fix PowerA init quirk for some gamepad models
The PowerA gamepad initialization quirk worked with the PowerA wired gamepad I had around (0x24c6:0x543a), but a user reported [0] that it didn't work for him, even though our gamepads shared the same vendor and product IDs. When I initially implemented the PowerA quirk, I wanted to avoid actually triggering the rumble action during init. My tests showed that my gamepad would work correctly even if it received a rumble of 0 intensity, so that's what I went with. Unfortunately, this apparently isn't true for all models (perhaps a firmware difference?). This non-working gamepad seems to require the real magic rumble packet that the Microsoft driver sends, which actually vibrates the gamepad. To counteract this effect, I still send the old zero-rumble PowerA quirk packet which cancels the rumble effect before the motors can spin up enough to vibrate. [0]: paroj/xpad#48 (comment) Reported-by: Kyle Beauchamp <[email protected]> Tested-by: Kyle Beauchamp <[email protected]> Fixes: 81093c9 ("Input: xpad - support some quirky Xbox One pads") Cc: [email protected] # v4.12 Signed-off-by: Cameron Gutman <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 3f9db52 commit f5308d1

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

drivers/input/joystick/xpad.c

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -476,10 +476,21 @@ static const u8 xboxone_hori_init[] = {
476476
};
477477

478478
/*
479-
* A rumble packet is required for some PowerA pads to start
479+
* A specific rumble packet is required for some PowerA pads to start
480480
* sending input reports. One of those pads is (0x24c6:0x543a).
481481
*/
482-
static const u8 xboxone_zerorumble_init[] = {
482+
static const u8 xboxone_rumblebegin_init[] = {
483+
0x09, 0x00, 0x00, 0x09, 0x00, 0x0F, 0x00, 0x00,
484+
0x1D, 0x1D, 0xFF, 0x00, 0x00
485+
};
486+
487+
/*
488+
* A rumble packet with zero FF intensity will immediately
489+
* terminate the rumbling required to init PowerA pads.
490+
* This should happen fast enough that the motors don't
491+
* spin up to enough speed to actually vibrate the gamepad.
492+
*/
493+
static const u8 xboxone_rumbleend_init[] = {
483494
0x09, 0x00, 0x00, 0x09, 0x00, 0x0F, 0x00, 0x00,
484495
0x00, 0x00, 0x00, 0x00, 0x00
485496
};
@@ -494,9 +505,12 @@ static const struct xboxone_init_packet xboxone_init_packets[] = {
494505
XBOXONE_INIT_PKT(0x0e6f, 0x0165, xboxone_hori_init),
495506
XBOXONE_INIT_PKT(0x0f0d, 0x0067, xboxone_hori_init),
496507
XBOXONE_INIT_PKT(0x0000, 0x0000, xboxone_fw2015_init),
497-
XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_zerorumble_init),
498-
XBOXONE_INIT_PKT(0x24c6, 0x542a, xboxone_zerorumble_init),
499-
XBOXONE_INIT_PKT(0x24c6, 0x543a, xboxone_zerorumble_init),
508+
XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_rumblebegin_init),
509+
XBOXONE_INIT_PKT(0x24c6, 0x542a, xboxone_rumblebegin_init),
510+
XBOXONE_INIT_PKT(0x24c6, 0x543a, xboxone_rumblebegin_init),
511+
XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_rumbleend_init),
512+
XBOXONE_INIT_PKT(0x24c6, 0x542a, xboxone_rumbleend_init),
513+
XBOXONE_INIT_PKT(0x24c6, 0x543a, xboxone_rumbleend_init),
500514
};
501515

502516
struct xpad_output_packet {

0 commit comments

Comments
 (0)