hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/input/joystick/xpad.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * X-Box gamepad driver
34 *
....@@ -10,21 +11,6 @@
1011 * 2006 Adam Buchbinder <adam.buchbinder@gmail.com>
1112 * 2007 Jan Kratochvil <honza@jikos.cz>
1213 * 2010 Christoph Fritz <chf.fritz@googlemail.com>
13
- *
14
- * This program is free software; you can redistribute it and/or
15
- * modify it under the terms of the GNU General Public License as
16
- * published by the Free Software Foundation; either version 2 of
17
- * the License, or (at your option) any later version.
18
- *
19
- * This program is distributed in the hope that it will be useful,
20
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
21
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
- * GNU General Public License for more details.
23
- *
24
- * You should have received a copy of the GNU General Public License
25
- * along with this program; if not, write to the Free Software
26
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27
- *
2814 *
2915 * This driver is based on:
3016 * - information from http://euc.jp/periphs/xbox-controller.ja.html
....@@ -126,6 +112,8 @@
126112 u8 xtype;
127113 } xpad_device[] = {
128114 { 0x0079, 0x18d4, "GPD Win 2 X-Box Controller", 0, XTYPE_XBOX360 },
115
+ { 0x03eb, 0xff01, "Wooting One (Legacy)", 0, XTYPE_XBOX360 },
116
+ { 0x03eb, 0xff02, "Wooting Two (Legacy)", 0, XTYPE_XBOX360 },
129117 { 0x044f, 0x0f00, "Thrustmaster Wheel", 0, XTYPE_XBOX },
130118 { 0x044f, 0x0f03, "Thrustmaster Wheel", 0, XTYPE_XBOX },
131119 { 0x044f, 0x0f07, "Thrustmaster, Inc. Controller", 0, XTYPE_XBOX },
....@@ -256,6 +244,7 @@
256244 { 0x0f0d, 0x0063, "Hori Real Arcade Pro Hayabusa (USA) Xbox One", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
257245 { 0x0f0d, 0x0067, "HORIPAD ONE", 0, XTYPE_XBOXONE },
258246 { 0x0f0d, 0x0078, "Hori Real Arcade Pro V Kai Xbox One", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
247
+ { 0x0f0d, 0x00c5, "Hori Fighting Commander ONE", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
259248 { 0x0f30, 0x010b, "Philips Recoil", 0, XTYPE_XBOX },
260249 { 0x0f30, 0x0202, "Joytech Advanced Controller", 0, XTYPE_XBOX },
261250 { 0x0f30, 0x8888, "BigBen XBMiniPad Controller", 0, XTYPE_XBOX },
....@@ -272,7 +261,7 @@
272261 { 0x1430, 0x8888, "TX6500+ Dance Pad (first generation)", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX },
273262 { 0x1430, 0xf801, "RedOctane Controller", 0, XTYPE_XBOX360 },
274263 { 0x146b, 0x0601, "BigBen Interactive XBOX 360 Controller", 0, XTYPE_XBOX360 },
275
- { 0x1532, 0x0037, "Razer Sabertooth", 0, XTYPE_XBOX360 },
264
+ { 0x146b, 0x0604, "Bigben Interactive DAIJA Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
276265 { 0x1532, 0x0a00, "Razer Atrox Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
277266 { 0x1532, 0x0a03, "Razer Wildcat", 0, XTYPE_XBOXONE },
278267 { 0x15e4, 0x3f00, "Power A Mini Pro Elite", 0, XTYPE_XBOX360 },
....@@ -336,6 +325,7 @@
336325 { 0x24c6, 0x5502, "Hori Fighting Stick VX Alt", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
337326 { 0x24c6, 0x5503, "Hori Fighting Edge", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
338327 { 0x24c6, 0x5506, "Hori SOULCALIBUR V Stick", 0, XTYPE_XBOX360 },
328
+ { 0x24c6, 0x5510, "Hori Fighting Commander ONE (Xbox 360/PC Mode)", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
339329 { 0x24c6, 0x550d, "Hori GEM Xbox controller", 0, XTYPE_XBOX360 },
340330 { 0x24c6, 0x550e, "Hori Real Arcade Pro V Kai 360", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
341331 { 0x24c6, 0x551a, "PowerA FUSION Pro Controller", 0, XTYPE_XBOXONE },
....@@ -345,6 +335,14 @@
345335 { 0x24c6, 0x5b03, "Thrustmaster Ferrari 458 Racing Wheel", 0, XTYPE_XBOX360 },
346336 { 0x24c6, 0x5d04, "Razer Sabertooth", 0, XTYPE_XBOX360 },
347337 { 0x24c6, 0xfafe, "Rock Candy Gamepad for Xbox 360", 0, XTYPE_XBOX360 },
338
+ { 0x2563, 0x058d, "OneXPlayer Gamepad", 0, XTYPE_XBOX360 },
339
+ { 0x2dc8, 0x2000, "8BitDo Pro 2 Wired Controller fox Xbox", 0, XTYPE_XBOXONE },
340
+ { 0x31e3, 0x1100, "Wooting One", 0, XTYPE_XBOX360 },
341
+ { 0x31e3, 0x1200, "Wooting Two", 0, XTYPE_XBOX360 },
342
+ { 0x31e3, 0x1210, "Wooting Lekker", 0, XTYPE_XBOX360 },
343
+ { 0x31e3, 0x1220, "Wooting Two HE", 0, XTYPE_XBOX360 },
344
+ { 0x31e3, 0x1300, "Wooting 60HE (AVR)", 0, XTYPE_XBOX360 },
345
+ { 0x31e3, 0x1310, "Wooting 60HE (ARM)", 0, XTYPE_XBOX360 },
348346 { 0x3285, 0x0607, "Nacon GC-100", 0, XTYPE_XBOX360 },
349347 { 0x3767, 0x0101, "Fanatec Speedster 3 Forceshock Wheel", 0, XTYPE_XBOX },
350348 { 0xffff, 0xffff, "Chinese-made Xbox Controller", 0, XTYPE_XBOX },
....@@ -430,6 +428,7 @@
430428 static const struct usb_device_id xpad_table[] = {
431429 { USB_INTERFACE_INFO('X', 'B', 0) }, /* X-Box USB-IF not approved class */
432430 XPAD_XBOX360_VENDOR(0x0079), /* GPD Win 2 Controller */
431
+ XPAD_XBOX360_VENDOR(0x03eb), /* Wooting Keyboards (Legacy) */
433432 XPAD_XBOX360_VENDOR(0x044f), /* Thrustmaster X-Box 360 controllers */
434433 XPAD_XBOX360_VENDOR(0x045e), /* Microsoft X-Box 360 controllers */
435434 XPAD_XBOXONE_VENDOR(0x045e), /* Microsoft X-Box One controllers */
....@@ -440,6 +439,7 @@
440439 { USB_DEVICE(0x0738, 0x4540) }, /* Mad Catz Beat Pad */
441440 XPAD_XBOXONE_VENDOR(0x0738), /* Mad Catz FightStick TE 2 */
442441 XPAD_XBOX360_VENDOR(0x07ff), /* Mad Catz GamePad */
442
+ XPAD_XBOX360_VENDOR(0x0c12), /* Zeroplus X-Box 360 controllers */
443443 XPAD_XBOX360_VENDOR(0x0e6f), /* 0x0e6f X-Box 360 controllers */
444444 XPAD_XBOXONE_VENDOR(0x0e6f), /* 0x0e6f X-Box One controllers */
445445 XPAD_XBOX360_VENDOR(0x0f0d), /* Hori Controllers */
....@@ -460,8 +460,12 @@
460460 XPAD_XBOXONE_VENDOR(0x20d6), /* PowerA Controllers */
461461 XPAD_XBOX360_VENDOR(0x24c6), /* PowerA Controllers */
462462 XPAD_XBOXONE_VENDOR(0x24c6), /* PowerA Controllers */
463
+ XPAD_XBOX360_VENDOR(0x2563), /* OneXPlayer Gamepad */
464
+ XPAD_XBOX360_VENDOR(0x260d), /* Dareu H101 */
465
+ XPAD_XBOXONE_VENDOR(0x2dc8), /* 8BitDo Pro 2 Wired Controller for Xbox */
463466 XPAD_XBOXONE_VENDOR(0x2e24), /* Hyperkin Duke X-Box One pad */
464467 XPAD_XBOX360_VENDOR(0x2f24), /* GameSir Controllers */
468
+ XPAD_XBOX360_VENDOR(0x31e3), /* Wooting Keyboards */
465469 XPAD_XBOX360_VENDOR(0x3285), /* Nacon GC-100 */
466470 { }
467471 };
....@@ -483,6 +487,9 @@
483487 .len = ARRAY_SIZE(_data), \
484488 }
485489
490
+
491
+#define GIP_WIRED_INTF_DATA 0
492
+#define GIP_WIRED_INTF_AUDIO 1
486493
487494 /*
488495 * This packet is required for all Xbox One pads with 2015
....@@ -1808,7 +1815,7 @@
18081815 }
18091816
18101817 if (xpad->xtype == XTYPE_XBOXONE &&
1811
- intf->cur_altsetting->desc.bInterfaceNumber != 0) {
1818
+ intf->cur_altsetting->desc.bInterfaceNumber != GIP_WIRED_INTF_DATA) {
18121819 /*
18131820 * The Xbox One controller lists three interfaces all with the
18141821 * same interface class, subclass and protocol. Differentiate by
....@@ -1978,7 +1985,6 @@
19781985 .disconnect = xpad_disconnect,
19791986 .suspend = xpad_suspend,
19801987 .resume = xpad_resume,
1981
- .reset_resume = xpad_resume,
19821988 .id_table = xpad_table,
19831989 };
19841990