diff options
Diffstat (limited to 'drivers/input/joystick/xpad.c')
| -rw-r--r-- | drivers/input/joystick/xpad.c | 25 | 
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index cdb193317c3b..ede380551e55 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -264,6 +264,7 @@ static const struct xpad_device {  	{ 0x0f0d, 0x0067, "HORIPAD ONE", 0, XTYPE_XBOXONE },  	{ 0x0f0d, 0x0078, "Hori Real Arcade Pro V Kai Xbox One", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },  	{ 0x0f0d, 0x00c5, "Hori Fighting Commander ONE", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE }, +	{ 0x0f0d, 0x00dc, "HORIPAD FPS for Nintendo Switch", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },  	{ 0x0f30, 0x010b, "Philips Recoil", 0, XTYPE_XBOX },  	{ 0x0f30, 0x0202, "Joytech Advanced Controller", 0, XTYPE_XBOX },  	{ 0x0f30, 0x8888, "BigBen XBMiniPad Controller", 0, XTYPE_XBOX }, @@ -365,6 +366,7 @@ static const struct xpad_device {  	{ 0x31e3, 0x1300, "Wooting 60HE (AVR)", 0, XTYPE_XBOX360 },  	{ 0x31e3, 0x1310, "Wooting 60HE (ARM)", 0, XTYPE_XBOX360 },  	{ 0x3285, 0x0607, "Nacon GC-100", 0, XTYPE_XBOX360 }, +	{ 0x3537, 0x1004, "GameSir T4 Kaleid", 0, XTYPE_XBOX360 },  	{ 0x3767, 0x0101, "Fanatec Speedster 3 Forceshock Wheel", 0, XTYPE_XBOX },  	{ 0xffff, 0xffff, "Chinese-made Xbox Controller", 0, XTYPE_XBOX },  	{ 0x0000, 0x0000, "Generic X-Box pad", 0, XTYPE_UNKNOWN } @@ -499,6 +501,8 @@ static const struct usb_device_id xpad_table[] = {  	XPAD_XBOX360_VENDOR(0x2f24),		/* GameSir controllers */  	XPAD_XBOX360_VENDOR(0x31e3),		/* Wooting Keyboards */  	XPAD_XBOX360_VENDOR(0x3285),		/* Nacon GC-100 */ +	XPAD_XBOX360_VENDOR(0x3537),		/* GameSir Controllers */ +	XPAD_XBOXONE_VENDOR(0x3537),		/* GameSir Controllers */  	{ }  }; @@ -1720,6 +1724,27 @@ static int xpad_start_input(struct usb_xpad *xpad)  			return error;  		}  	} +	if (xpad->xtype == XTYPE_XBOX360) { +		/* +		 * Some third-party controllers Xbox 360-style controllers +		 * require this message to finish initialization. +		 */ +		u8 dummy[20]; + +		error = usb_control_msg_recv(xpad->udev, 0, +					     /* bRequest */ 0x01, +					     /* bmRequestType */ +					     USB_TYPE_VENDOR | USB_DIR_IN | +						USB_RECIP_INTERFACE, +					     /* wValue */ 0x100, +					     /* wIndex */ 0x00, +					     dummy, sizeof(dummy), +					     25, GFP_KERNEL); +		if (error) +			dev_warn(&xpad->dev->dev, +				 "unable to receive magic message: %d\n", +				 error); +	}  	return 0;  }  |