| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * X-Box gamepad driver |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 10 | 11 | * 2006 Adam Buchbinder <adam.buchbinder@gmail.com> |
|---|
| 11 | 12 | * 2007 Jan Kratochvil <honza@jikos.cz> |
|---|
| 12 | 13 | * 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 | | - * |
|---|
| 28 | 14 | * |
|---|
| 29 | 15 | * This driver is based on: |
|---|
| 30 | 16 | * - information from http://euc.jp/periphs/xbox-controller.ja.html |
|---|
| .. | .. |
|---|
| 126 | 112 | u8 xtype; |
|---|
| 127 | 113 | } xpad_device[] = { |
|---|
| 128 | 114 | { 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 }, |
|---|
| 129 | 117 | { 0x044f, 0x0f00, "Thrustmaster Wheel", 0, XTYPE_XBOX }, |
|---|
| 130 | 118 | { 0x044f, 0x0f03, "Thrustmaster Wheel", 0, XTYPE_XBOX }, |
|---|
| 131 | 119 | { 0x044f, 0x0f07, "Thrustmaster, Inc. Controller", 0, XTYPE_XBOX }, |
|---|
| .. | .. |
|---|
| 256 | 244 | { 0x0f0d, 0x0063, "Hori Real Arcade Pro Hayabusa (USA) Xbox One", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE }, |
|---|
| 257 | 245 | { 0x0f0d, 0x0067, "HORIPAD ONE", 0, XTYPE_XBOXONE }, |
|---|
| 258 | 246 | { 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 }, |
|---|
| 259 | 248 | { 0x0f30, 0x010b, "Philips Recoil", 0, XTYPE_XBOX }, |
|---|
| 260 | 249 | { 0x0f30, 0x0202, "Joytech Advanced Controller", 0, XTYPE_XBOX }, |
|---|
| 261 | 250 | { 0x0f30, 0x8888, "BigBen XBMiniPad Controller", 0, XTYPE_XBOX }, |
|---|
| .. | .. |
|---|
| 272 | 261 | { 0x1430, 0x8888, "TX6500+ Dance Pad (first generation)", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX }, |
|---|
| 273 | 262 | { 0x1430, 0xf801, "RedOctane Controller", 0, XTYPE_XBOX360 }, |
|---|
| 274 | 263 | { 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 }, |
|---|
| 276 | 265 | { 0x1532, 0x0a00, "Razer Atrox Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE }, |
|---|
| 277 | 266 | { 0x1532, 0x0a03, "Razer Wildcat", 0, XTYPE_XBOXONE }, |
|---|
| 278 | 267 | { 0x15e4, 0x3f00, "Power A Mini Pro Elite", 0, XTYPE_XBOX360 }, |
|---|
| .. | .. |
|---|
| 336 | 325 | { 0x24c6, 0x5502, "Hori Fighting Stick VX Alt", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, |
|---|
| 337 | 326 | { 0x24c6, 0x5503, "Hori Fighting Edge", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, |
|---|
| 338 | 327 | { 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 }, |
|---|
| 339 | 329 | { 0x24c6, 0x550d, "Hori GEM Xbox controller", 0, XTYPE_XBOX360 }, |
|---|
| 340 | 330 | { 0x24c6, 0x550e, "Hori Real Arcade Pro V Kai 360", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, |
|---|
| 341 | 331 | { 0x24c6, 0x551a, "PowerA FUSION Pro Controller", 0, XTYPE_XBOXONE }, |
|---|
| .. | .. |
|---|
| 345 | 335 | { 0x24c6, 0x5b03, "Thrustmaster Ferrari 458 Racing Wheel", 0, XTYPE_XBOX360 }, |
|---|
| 346 | 336 | { 0x24c6, 0x5d04, "Razer Sabertooth", 0, XTYPE_XBOX360 }, |
|---|
| 347 | 337 | { 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 }, |
|---|
| 348 | 346 | { 0x3285, 0x0607, "Nacon GC-100", 0, XTYPE_XBOX360 }, |
|---|
| 349 | 347 | { 0x3767, 0x0101, "Fanatec Speedster 3 Forceshock Wheel", 0, XTYPE_XBOX }, |
|---|
| 350 | 348 | { 0xffff, 0xffff, "Chinese-made Xbox Controller", 0, XTYPE_XBOX }, |
|---|
| .. | .. |
|---|
| 430 | 428 | static const struct usb_device_id xpad_table[] = { |
|---|
| 431 | 429 | { USB_INTERFACE_INFO('X', 'B', 0) }, /* X-Box USB-IF not approved class */ |
|---|
| 432 | 430 | XPAD_XBOX360_VENDOR(0x0079), /* GPD Win 2 Controller */ |
|---|
| 431 | + XPAD_XBOX360_VENDOR(0x03eb), /* Wooting Keyboards (Legacy) */ |
|---|
| 433 | 432 | XPAD_XBOX360_VENDOR(0x044f), /* Thrustmaster X-Box 360 controllers */ |
|---|
| 434 | 433 | XPAD_XBOX360_VENDOR(0x045e), /* Microsoft X-Box 360 controllers */ |
|---|
| 435 | 434 | XPAD_XBOXONE_VENDOR(0x045e), /* Microsoft X-Box One controllers */ |
|---|
| .. | .. |
|---|
| 440 | 439 | { USB_DEVICE(0x0738, 0x4540) }, /* Mad Catz Beat Pad */ |
|---|
| 441 | 440 | XPAD_XBOXONE_VENDOR(0x0738), /* Mad Catz FightStick TE 2 */ |
|---|
| 442 | 441 | XPAD_XBOX360_VENDOR(0x07ff), /* Mad Catz GamePad */ |
|---|
| 442 | + XPAD_XBOX360_VENDOR(0x0c12), /* Zeroplus X-Box 360 controllers */ |
|---|
| 443 | 443 | XPAD_XBOX360_VENDOR(0x0e6f), /* 0x0e6f X-Box 360 controllers */ |
|---|
| 444 | 444 | XPAD_XBOXONE_VENDOR(0x0e6f), /* 0x0e6f X-Box One controllers */ |
|---|
| 445 | 445 | XPAD_XBOX360_VENDOR(0x0f0d), /* Hori Controllers */ |
|---|
| .. | .. |
|---|
| 460 | 460 | XPAD_XBOXONE_VENDOR(0x20d6), /* PowerA Controllers */ |
|---|
| 461 | 461 | XPAD_XBOX360_VENDOR(0x24c6), /* PowerA Controllers */ |
|---|
| 462 | 462 | 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 */ |
|---|
| 463 | 466 | XPAD_XBOXONE_VENDOR(0x2e24), /* Hyperkin Duke X-Box One pad */ |
|---|
| 464 | 467 | XPAD_XBOX360_VENDOR(0x2f24), /* GameSir Controllers */ |
|---|
| 468 | + XPAD_XBOX360_VENDOR(0x31e3), /* Wooting Keyboards */ |
|---|
| 465 | 469 | XPAD_XBOX360_VENDOR(0x3285), /* Nacon GC-100 */ |
|---|
| 466 | 470 | { } |
|---|
| 467 | 471 | }; |
|---|
| .. | .. |
|---|
| 483 | 487 | .len = ARRAY_SIZE(_data), \ |
|---|
| 484 | 488 | } |
|---|
| 485 | 489 | |
|---|
| 490 | + |
|---|
| 491 | +#define GIP_WIRED_INTF_DATA 0 |
|---|
| 492 | +#define GIP_WIRED_INTF_AUDIO 1 |
|---|
| 486 | 493 | |
|---|
| 487 | 494 | /* |
|---|
| 488 | 495 | * This packet is required for all Xbox One pads with 2015 |
|---|
| .. | .. |
|---|
| 1808 | 1815 | } |
|---|
| 1809 | 1816 | |
|---|
| 1810 | 1817 | if (xpad->xtype == XTYPE_XBOXONE && |
|---|
| 1811 | | - intf->cur_altsetting->desc.bInterfaceNumber != 0) { |
|---|
| 1818 | + intf->cur_altsetting->desc.bInterfaceNumber != GIP_WIRED_INTF_DATA) { |
|---|
| 1812 | 1819 | /* |
|---|
| 1813 | 1820 | * The Xbox One controller lists three interfaces all with the |
|---|
| 1814 | 1821 | * same interface class, subclass and protocol. Differentiate by |
|---|
| .. | .. |
|---|
| 1978 | 1985 | .disconnect = xpad_disconnect, |
|---|
| 1979 | 1986 | .suspend = xpad_suspend, |
|---|
| 1980 | 1987 | .resume = xpad_resume, |
|---|
| 1981 | | - .reset_resume = xpad_resume, |
|---|
| 1982 | 1988 | .id_table = xpad_table, |
|---|
| 1983 | 1989 | }; |
|---|
| 1984 | 1990 | |
|---|