|
93 | 93 | #define MAP_STICKS_TO_NULL (1 << 2)
|
94 | 94 | #define DANCEPAD_MAP_CONFIG (MAP_DPAD_TO_BUTTONS | \
|
95 | 95 | MAP_TRIGGERS_TO_BUTTONS | MAP_STICKS_TO_NULL)
|
| 96 | +#define SWITCH_G920_TO_HID_MODE (1 << 3) |
96 | 97 |
|
97 | 98 | #define XTYPE_XBOX 0
|
98 | 99 | #define XTYPE_XBOX360 1
|
@@ -133,6 +134,7 @@ static const struct xpad_device {
|
133 | 134 | { 0x046d, 0xc21e, "Logitech Gamepad F510", 0, XTYPE_XBOX360 },
|
134 | 135 | { 0x046d, 0xc21f, "Logitech Gamepad F710", 0, XTYPE_XBOX360 },
|
135 | 136 | { 0x046d, 0xc242, "Logitech Chillstream Controller", 0, XTYPE_XBOX360 },
|
| 137 | + { 0x046d, 0xc261, "Logitech G920 Driving Force Racing Wheel", SWITCH_G920_TO_HID_MODE, XTYPE_XBOXONE }, |
136 | 138 | { 0x046d, 0xca84, "Logitech Xbox Cordless Controller", 0, XTYPE_XBOX },
|
137 | 139 | { 0x046d, 0xca88, "Logitech Compact Controller for Xbox", 0, XTYPE_XBOX },
|
138 | 140 | { 0x05fd, 0x1007, "Mad Catz Controller (unverified)", 0, XTYPE_XBOX },
|
@@ -299,6 +301,7 @@ static struct usb_device_id xpad_table[] = {
|
299 | 301 | XPAD_XBOX360_VENDOR(0x045e), /* Microsoft X-Box 360 controllers */
|
300 | 302 | XPAD_XBOXONE_VENDOR(0x045e), /* Microsoft X-Box One controllers */
|
301 | 303 | XPAD_XBOX360_VENDOR(0x046d), /* Logitech X-Box 360 style controllers */
|
| 304 | + XPAD_XBOXONE_VENDOR(0x046d), /* Logitech X-Box One style controllers */ |
302 | 305 | XPAD_XBOX360_VENDOR(0x0738), /* Mad Catz X-Box 360 controllers */
|
303 | 306 | { USB_DEVICE(0x0738, 0x4540) }, /* Mad Catz Beat Pad */
|
304 | 307 | XPAD_XBOX360_VENDOR(0x0e6f), /* 0x0e6f X-Box 360 controllers */
|
@@ -1021,6 +1024,19 @@ static int xpad_open(struct input_dev *dev)
|
1021 | 1024 | if (usb_submit_urb(xpad->irq_in, GFP_KERNEL))
|
1022 | 1025 | return -EIO;
|
1023 | 1026 |
|
| 1027 | + /* Logitect G920 wheel starts in XBOX mode, but is reconfigured to be HID */ |
| 1028 | + /* device with USBID of 046D:C262. Wheel will detach when 'magic' is sent. */ |
| 1029 | + if (xpad->mapping & SWITCH_G920_TO_HID_MODE) { |
| 1030 | + xpad->odata[0] = 0x0F; |
| 1031 | + xpad->odata[1] = 0x00; |
| 1032 | + xpad->odata[2] = 0x01; |
| 1033 | + xpad->odata[3] = 0x01; |
| 1034 | + xpad->odata[4] = 0x42; |
| 1035 | + xpad->irq_out->transfer_buffer_length = 5; |
| 1036 | + |
| 1037 | + return usb_submit_urb(xpad->irq_out, GFP_KERNEL); |
| 1038 | + } |
| 1039 | + |
1024 | 1040 | if (xpad->xtype == XTYPE_XBOXONE) {
|
1025 | 1041 | /* Xbox one controller needs to be initialized. */
|
1026 | 1042 | xpad->odata[0] = 0x05;
|
|
0 commit comments