]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.4.44/input-xpad-use-correct-product-id-for-x360w-controllers.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.4.44 / input-xpad-use-correct-product-id-for-x360w-controllers.patch
1 From b6fc513da50c5dbc457a8ad6b58b046a6a68fd9d Mon Sep 17 00:00:00 2001
2 From: Pavel Rojtberg <rojtberg@gmail.com>
3 Date: Tue, 27 Dec 2016 11:44:51 -0800
4 Subject: Input: xpad - use correct product id for x360w controllers
5
6 From: Pavel Rojtberg <rojtberg@gmail.com>
7
8 commit b6fc513da50c5dbc457a8ad6b58b046a6a68fd9d upstream.
9
10 currently the controllers get the same product id as the wireless
11 receiver. However the controllers actually have their own product id.
12
13 The patch makes the driver expose the same product id as the windows
14 driver.
15
16 This improves compatibility when running applications with WINE.
17
18 see https://github.com/paroj/xpad/issues/54
19
20 Signed-off-by: Pavel Rojtberg <rojtberg@gmail.com>
21 Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
22 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23
24 ---
25 drivers/input/joystick/xpad.c | 6 ++++++
26 1 file changed, 6 insertions(+)
27
28 --- a/drivers/input/joystick/xpad.c
29 +++ b/drivers/input/joystick/xpad.c
30 @@ -1238,6 +1238,12 @@ static int xpad_init_input(struct usb_xp
31 input_dev->name = xpad->name;
32 input_dev->phys = xpad->phys;
33 usb_to_input_id(xpad->udev, &input_dev->id);
34 +
35 + if (xpad->xtype == XTYPE_XBOX360W) {
36 + /* x360w controllers and the receiver have different ids */
37 + input_dev->id.product = 0x02a1;
38 + }
39 +
40 input_dev->dev.parent = &xpad->intf->dev;
41
42 input_set_drvdata(input_dev, xpad);