aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2015-11-20 04:28:40 -0500
committerJiri Kosina <jkosina@suse.cz>2015-11-20 04:28:40 -0500
commit2f23985879c2fb2967e8bca77b1014b437a9b9ff (patch)
tree429f6914125df178d941c5f6c5a23beddeb6ed70
parent319645cac26c2d065a485f5d59228433ad602f71 (diff)
parent27b9d5a254dcbc6095404c1bab7c335419601eb8 (diff)
Merge branch 'for-dmitry/logitech-g920-merge-base' into for-4.5/logitech
Pull the branch that has been established to be jointly merged to both hid.git and input.git, because both trees have different depending patches on top. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/input/joystick/xpad.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index fd4100d56d8c..338a3a4f8996 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -93,6 +93,7 @@
93#define MAP_STICKS_TO_NULL (1 << 2) 93#define MAP_STICKS_TO_NULL (1 << 2)
94#define DANCEPAD_MAP_CONFIG (MAP_DPAD_TO_BUTTONS | \ 94#define DANCEPAD_MAP_CONFIG (MAP_DPAD_TO_BUTTONS | \
95 MAP_TRIGGERS_TO_BUTTONS | MAP_STICKS_TO_NULL) 95 MAP_TRIGGERS_TO_BUTTONS | MAP_STICKS_TO_NULL)
96#define SWITCH_G920_TO_HID_MODE (1 << 3)
96 97
97#define XTYPE_XBOX 0 98#define XTYPE_XBOX 0
98#define XTYPE_XBOX360 1 99#define XTYPE_XBOX360 1
@@ -134,6 +135,7 @@ static const struct xpad_device {
134 { 0x046d, 0xc21e, "Logitech Gamepad F510", 0, XTYPE_XBOX360 }, 135 { 0x046d, 0xc21e, "Logitech Gamepad F510", 0, XTYPE_XBOX360 },
135 { 0x046d, 0xc21f, "Logitech Gamepad F710", 0, XTYPE_XBOX360 }, 136 { 0x046d, 0xc21f, "Logitech Gamepad F710", 0, XTYPE_XBOX360 },
136 { 0x046d, 0xc242, "Logitech Chillstream Controller", 0, XTYPE_XBOX360 }, 137 { 0x046d, 0xc242, "Logitech Chillstream Controller", 0, XTYPE_XBOX360 },
138 { 0x046d, 0xc261, "Logitech G920 Driving Force Racing Wheel", SWITCH_G920_TO_HID_MODE, XTYPE_XBOXONE },
137 { 0x046d, 0xca84, "Logitech Xbox Cordless Controller", 0, XTYPE_XBOX }, 139 { 0x046d, 0xca84, "Logitech Xbox Cordless Controller", 0, XTYPE_XBOX },
138 { 0x046d, 0xca88, "Logitech Compact Controller for Xbox", 0, XTYPE_XBOX }, 140 { 0x046d, 0xca88, "Logitech Compact Controller for Xbox", 0, XTYPE_XBOX },
139 { 0x05fd, 0x1007, "Mad Catz Controller (unverified)", 0, XTYPE_XBOX }, 141 { 0x05fd, 0x1007, "Mad Catz Controller (unverified)", 0, XTYPE_XBOX },
@@ -299,6 +301,7 @@ static struct usb_device_id xpad_table[] = {
299 XPAD_XBOX360_VENDOR(0x045e), /* Microsoft X-Box 360 controllers */ 301 XPAD_XBOX360_VENDOR(0x045e), /* Microsoft X-Box 360 controllers */
300 XPAD_XBOXONE_VENDOR(0x045e), /* Microsoft X-Box One controllers */ 302 XPAD_XBOXONE_VENDOR(0x045e), /* Microsoft X-Box One controllers */
301 XPAD_XBOX360_VENDOR(0x046d), /* Logitech X-Box 360 style controllers */ 303 XPAD_XBOX360_VENDOR(0x046d), /* Logitech X-Box 360 style controllers */
304 XPAD_XBOXONE_VENDOR(0x046d), /* Logitech X-Box One style controllers */
302 XPAD_XBOX360_VENDOR(0x0738), /* Mad Catz X-Box 360 controllers */ 305 XPAD_XBOX360_VENDOR(0x0738), /* Mad Catz X-Box 360 controllers */
303 { USB_DEVICE(0x0738, 0x4540) }, /* Mad Catz Beat Pad */ 306 { USB_DEVICE(0x0738, 0x4540) }, /* Mad Catz Beat Pad */
304 XPAD_XBOX360_VENDOR(0x0e6f), /* 0x0e6f X-Box 360 controllers */ 307 XPAD_XBOX360_VENDOR(0x0e6f), /* 0x0e6f X-Box 360 controllers */
@@ -1048,6 +1051,19 @@ static int xpad_open(struct input_dev *dev)
1048 if (usb_submit_urb(xpad->irq_in, GFP_KERNEL)) 1051 if (usb_submit_urb(xpad->irq_in, GFP_KERNEL))
1049 return -EIO; 1052 return -EIO;
1050 1053
1054 /* Logitect G920 wheel starts in XBOX mode, but is reconfigured to be HID */
1055 /* device with USBID of 046D:C262. Wheel will detach when 'magic' is sent. */
1056 if (xpad->mapping & SWITCH_G920_TO_HID_MODE) {
1057 xpad->odata[0] = 0x0F;
1058 xpad->odata[1] = 0x00;
1059 xpad->odata[2] = 0x01;
1060 xpad->odata[3] = 0x01;
1061 xpad->odata[4] = 0x42;
1062 xpad->irq_out->transfer_buffer_length = 5;
1063
1064 return usb_submit_urb(xpad->irq_out, GFP_KERNEL);
1065 }
1066
1051 if (xpad->xtype == XTYPE_XBOXONE) { 1067 if (xpad->xtype == XTYPE_XBOXONE) {
1052 /* Xbox one controller needs to be initialized. */ 1068 /* Xbox one controller needs to be initialized. */
1053 xpad->odata[0] = 0x05; 1069 xpad->odata[0] = 0x05;