aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/joystick/xpad.c
diff options
context:
space:
mode:
authorCameron Gutman <aicommander@gmail.com>2016-06-01 14:32:51 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2016-06-01 17:21:27 -0400
commit540c26087bfbad6ea72758b76b16ae6282a73fea (patch)
tree58a63a585c66495ef1bbcddc7ddce4e9cc2a30fc /drivers/input/joystick/xpad.c
parentf49cf3b8b4c841457244c461c66186a719e13bcc (diff)
Input: xpad - fix rumble on Xbox One controllers with 2015 firmware
Xbox One controllers that shipped with or were upgraded to the 2015 firmware discard the current rumble packets we send. This patch changes the Xbox One rumble packet to a form that both the newer and older firmware will accept. It is based on changes made to support newer Xbox One controllers in the SteamOS brewmaster-4.1 kernel branch. Signed-off-by: Cameron Gutman <aicommander@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/joystick/xpad.c')
-rw-r--r--drivers/input/joystick/xpad.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 804dbcc37d3f..923c57236c51 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -1031,17 +1031,17 @@ static int xpad_play_effect(struct input_dev *dev, void *data, struct ff_effect
1031 1031
1032 case XTYPE_XBOXONE: 1032 case XTYPE_XBOXONE:
1033 packet->data[0] = 0x09; /* activate rumble */ 1033 packet->data[0] = 0x09; /* activate rumble */
1034 packet->data[1] = 0x08; 1034 packet->data[1] = 0x00;
1035 packet->data[2] = xpad->odata_serial++; 1035 packet->data[2] = xpad->odata_serial++;
1036 packet->data[3] = 0x08; /* continuous effect */ 1036 packet->data[3] = 0x09;
1037 packet->data[4] = 0x00; /* simple rumble mode */ 1037 packet->data[4] = 0x00;
1038 packet->data[5] = 0x03; /* L and R actuator only */ 1038 packet->data[5] = 0x0F;
1039 packet->data[6] = 0x00; /* TODO: LT actuator */ 1039 packet->data[6] = 0x00;
1040 packet->data[7] = 0x00; /* TODO: RT actuator */ 1040 packet->data[7] = 0x00;
1041 packet->data[8] = strong / 512; /* left actuator */ 1041 packet->data[8] = strong / 512; /* left actuator */
1042 packet->data[9] = weak / 512; /* right actuator */ 1042 packet->data[9] = weak / 512; /* right actuator */
1043 packet->data[10] = 0x80; /* length of pulse */ 1043 packet->data[10] = 0xFF;
1044 packet->data[11] = 0x00; /* stop period of pulse */ 1044 packet->data[11] = 0x00;
1045 packet->data[12] = 0x00; 1045 packet->data[12] = 0x00;
1046 packet->len = 13; 1046 packet->len = 13;
1047 packet->pending = true; 1047 packet->pending = true;