diff options
Diffstat (limited to '0001-HID.patch')
-rw-r--r-- | 0001-HID.patch | 201 |
1 files changed, 24 insertions, 177 deletions
diff --git a/0001-HID.patch b/0001-HID.patch index eab0dd5e61b8..e2efea6d660e 100644 --- a/0001-HID.patch +++ b/0001-HID.patch @@ -1,7 +1,7 @@ -From b899859fe49cccda9e8739d29d883dbd6dd057f3 Mon Sep 17 00:00:00 2001 +From a9ccf84a04fc85556161640c5031735dce06c661 Mon Sep 17 00:00:00 2001 From: Vicki Pfau <vi@endrift.com> Date: Thu, 30 Jun 2022 18:42:10 -0700 -Subject: [PATCH 01/10] USB: gadget: f_hid: Add Get-Feature report +Subject: [PATCH 1/7] USB: gadget: f_hid: Add Get-Feature report While the HID gadget implementation has been sufficient for devices that only use INTERRUPT transfers, the USB HID standard includes provisions for Set- and @@ -25,7 +25,7 @@ Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> create mode 100644 include/uapi/linux/usb/g_hid.h diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c -index ea85e2c701a15..6fec92b5a0bd9 100644 +index ea85e2c701a15f..6fec92b5a0bd99 100644 --- a/drivers/usb/gadget/function/f_hid.c +++ b/drivers/usb/gadget/function/f_hid.c @@ -16,6 +16,7 @@ @@ -239,7 +239,7 @@ index ea85e2c701a15..6fec92b5a0bd9 100644 diff --git a/include/uapi/linux/usb/g_hid.h b/include/uapi/linux/usb/g_hid.h new file mode 100644 -index 0000000000000..c6068b4863543 +index 00000000000000..c6068b4863543f --- /dev/null +++ b/include/uapi/linux/usb/g_hid.h @@ -0,0 +1,38 @@ @@ -282,7 +282,7 @@ index 0000000000000..c6068b4863543 + +#endif /* __UAPI_LINUX_USB_G_HID_H */ diff --git a/include/uapi/linux/usb/gadgetfs.h b/include/uapi/linux/usb/gadgetfs.h -index 835473910a498..9754822b2a409 100644 +index 835473910a4980..9754822b2a409e 100644 --- a/include/uapi/linux/usb/gadgetfs.h +++ b/include/uapi/linux/usb/gadgetfs.h @@ -62,7 +62,7 @@ struct usb_gadgetfs_event { @@ -294,14 +294,11 @@ index 835473910a498..9754822b2a409 100644 * Don't add any colliding codes to either driver, and keep * them in unique ranges (size 0x20 for now). */ --- -2.41.0 - -From 20ebaf7b44ff03078cf53e43306d6c5a3d0613e6 Mon Sep 17 00:00:00 2001 +From d53013c39bab99518664ac507f01423606eac4e7 Mon Sep 17 00:00:00 2001 From: Vicki Pfau <vi@endrift.com> Date: Thu, 30 Jun 2022 18:43:10 -0700 -Subject: [PATCH 02/10] USB: gadget: f_hid: Add Set-Feature report +Subject: [PATCH 2/7] USB: gadget: f_hid: Add Set-Feature report While the HID gadget implementation has been sufficient for devices that only use INTERRUPT transfers, the USB HID standard includes provisions for Set- and @@ -323,7 +320,7 @@ Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> 2 files changed, 106 insertions(+), 28 deletions(-) diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c -index 6fec92b5a0bd9..172cba91aded1 100644 +index 6fec92b5a0bd99..172cba91aded11 100644 --- a/drivers/usb/gadget/function/f_hid.c +++ b/drivers/usb/gadget/function/f_hid.c @@ -76,6 +76,11 @@ struct f_hidg { @@ -514,7 +511,7 @@ index 6fec92b5a0bd9..172cba91aded1 100644 /* create char device */ cdev_init(&hidg->cdev, &f_hidg_fops); diff --git a/include/uapi/linux/usb/g_hid.h b/include/uapi/linux/usb/g_hid.h -index c6068b4863543..54814c2c68d60 100644 +index c6068b4863543f..54814c2c68d608 100644 --- a/include/uapi/linux/usb/g_hid.h +++ b/include/uapi/linux/usb/g_hid.h @@ -1,38 +1,22 @@ @@ -560,14 +557,11 @@ index c6068b4863543..54814c2c68d60 100644 #define GADGET_HID_WRITE_GET_REPORT _IOW('g', 0x42, struct usb_hidg_report) #endif /* __UAPI_LINUX_USB_G_HID_H */ --- -2.41.0 - -From 146e98d6f595e3a4e6c09a00ee9ec2d48a6703cb Mon Sep 17 00:00:00 2001 +From 4265c89f5f389b39d229c5e849d8bdba3aa5a044 Mon Sep 17 00:00:00 2001 From: Vicki Pfau <vi@endrift.com> Date: Tue, 29 Nov 2022 18:32:58 -0800 -Subject: [PATCH 03/10] HID: hid-steam: Update list of identifiers from SDL +Subject: [PATCH 3/7] HID: hid-steam: Update list of identifiers from SDL SDL includes a list of settings (registers), reports (cmds), and various other identifiers that were provided by Valve. This commit imports a significant @@ -581,7 +575,7 @@ Signed-off-by: Vicki Pfau <vi@endrift.com> 1 file changed, 121 insertions(+), 35 deletions(-) diff --git a/drivers/hid/hid-steam.c b/drivers/hid/hid-steam.c -index b110818fc9458..39a9bf3b7f77d 100644 +index b110818fc94586..39a9bf3b7f77d8 100644 --- a/drivers/hid/hid-steam.c +++ b/drivers/hid/hid-steam.c @@ -71,7 +71,7 @@ static LIST_HEAD(steam_devices); @@ -827,14 +821,11 @@ index b110818fc9458..39a9bf3b7f77d 100644 0); schedule_delayed_work(&steam->heartbeat, 5 * HZ); } --- -2.41.0 - -From 4b1dd1ebfd2d3f123212e1296d304909e5b3a406 Mon Sep 17 00:00:00 2001 +From 7b2d90f93687de4bbc49fd9dc0d002308ad35fd3 Mon Sep 17 00:00:00 2001 From: Vicki Pfau <vi@endrift.com> Date: Wed, 16 Nov 2022 19:54:26 -0800 -Subject: [PATCH 04/10] HID: hid-steam: Add gamepad-only mode switched to by +Subject: [PATCH 4/7] HID: hid-steam: Add gamepad-only mode switched to by holding options Signed-off-by: Vicki Pfau <vi@endrift.com> @@ -843,7 +834,7 @@ Signed-off-by: Vicki Pfau <vi@endrift.com> 1 file changed, 72 insertions(+) diff --git a/drivers/hid/hid-steam.c b/drivers/hid/hid-steam.c -index 39a9bf3b7f77d..0620046b142ef 100644 +index 39a9bf3b7f77d8..0620046b142ef5 100644 --- a/drivers/hid/hid-steam.c +++ b/drivers/hid/hid-steam.c @@ -202,6 +202,11 @@ static LIST_HEAD(steam_devices); @@ -981,14 +972,11 @@ index 39a9bf3b7f77d..0620046b142ef 100644 } /* --- -2.41.0 - -From 187582492c359d56865759f120214cfe6fa4ed50 Mon Sep 17 00:00:00 2001 +From 295c78a31c4ef285272fe5f00a88b8c5c3e0fd91 Mon Sep 17 00:00:00 2001 From: Vicki Pfau <vi@endrift.com> Date: Mon, 8 May 2023 20:24:56 -0700 -Subject: [PATCH 05/10] HID: hid-steam: Clean up locking +Subject: [PATCH 5/7] HID: hid-steam: Clean up locking This cleans up the locking logic so that the spinlock is consistently used for access to a small handful of struct variables, and the mutex is exclusively and @@ -1003,7 +991,7 @@ Signed-off-by: Vicki Pfau <vi@endrift.com> 1 file changed, 90 insertions(+), 58 deletions(-) diff --git a/drivers/hid/hid-steam.c b/drivers/hid/hid-steam.c -index 0620046b142ef..845ca71b8bd3a 100644 +index 0620046b142ef5..845ca71b8bd3ab 100644 --- a/drivers/hid/hid-steam.c +++ b/drivers/hid/hid-steam.c @@ -214,7 +214,7 @@ struct steam_device { @@ -1388,14 +1376,11 @@ index 0620046b142ef..845ca71b8bd3a 100644 } mutex_unlock(&steam_devices_lock); return 0; --- -2.41.0 - -From d4490c88bed06b4c18af4a6029d67374df5218e1 Mon Sep 17 00:00:00 2001 +From 2112ff750681f512405c95b0fb111fb1421b8d5b Mon Sep 17 00:00:00 2001 From: Vicki Pfau <vi@endrift.com> Date: Wed, 10 May 2023 17:27:12 -0700 -Subject: [PATCH 06/10] HID: hid-steam: Make client_opened a counter +Subject: [PATCH 6/7] HID: hid-steam: Make client_opened a counter The client_opened variable was used to track if the hidraw was opened by any clients to silence keyboard/mouse events while opened. However, there was no @@ -1409,7 +1394,7 @@ Signed-off-by: Vicki Pfau <vi@endrift.com> 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/hid/hid-steam.c b/drivers/hid/hid-steam.c -index 845ca71b8bd3a..0c2fe51b29bc1 100644 +index 845ca71b8bd3ab..0c2fe51b29bc10 100644 --- a/drivers/hid/hid-steam.c +++ b/drivers/hid/hid-steam.c @@ -215,7 +215,7 @@ struct steam_device { @@ -1457,14 +1442,11 @@ index 845ca71b8bd3a..0c2fe51b29bc1 100644 if (steam->quirks & STEAM_QUIRK_WIRELESS) { hid_info(hdev, "Steam wireless receiver disconnected"); } --- -2.41.0 - -From 58a8667b251984ecc85a503c5dec3fc8f98028ff Mon Sep 17 00:00:00 2001 +From 5ebbce0dd01a1682a64b211f00f1b82c5535eca2 Mon Sep 17 00:00:00 2001 From: Vicki Pfau <vi@endrift.com> Date: Thu, 18 May 2023 18:00:35 -0700 -Subject: [PATCH 07/10] HID: hid-steam: Better handling of serial number length +Subject: [PATCH 7/7] HID: hid-steam: Better handling of serial number length The second byte of the GET_STRING_ATTRIB report is a length, so we should set the size of the buffer to be the size we're actually requesting, and only @@ -1476,7 +1458,7 @@ Signed-off-by: Vicki Pfau <vi@endrift.com> 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/hid/hid-steam.c b/drivers/hid/hid-steam.c -index 0c2fe51b29bc1..92e3e1052fa42 100644 +index 0c2fe51b29bc10..92e3e1052fa423 100644 --- a/drivers/hid/hid-steam.c +++ b/drivers/hid/hid-steam.c @@ -208,7 +208,7 @@ static LIST_HEAD(steam_devices); @@ -1516,138 +1498,3 @@ index 0c2fe51b29bc1..92e3e1052fa42 100644 out: mutex_unlock(&steam->report_mutex); return ret; --- -2.41.0 - - -From 7460867bd78651a6187ac44c73d1be653c09973b Mon Sep 17 00:00:00 2001 -From: Vicki Pfau <vi@endrift.com> -Date: Fri, 24 Mar 2023 10:42:27 -0700 -Subject: [PATCH 08/10] Input: xpad - fix support for some third-party - controllers - -Some third-party controllers, such as the HORPIAD FPS for Nintendo Switch and -Gamesir-G3w, require a specific packet that the first-party XInput driver sends -before it will start sending reports. It's not currently known what this packet -does, but since the first-party driver always sends it's unlikely that this -could cause issues with existing controllers. - -Co-authored-by: Andrey Smirnov <andrew.smirnov@gmail.com> -Signed-off-by: Vicki Pfau <vi@endrift.com> -Link: https://lore.kernel.org/r/20230324040446.3487725-3-vi@endrift.com -Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> ---- - drivers/input/joystick/xpad.c | 22 ++++++++++++++++++++++ - 1 file changed, 22 insertions(+) - -diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c -index cdb193317c3b6..fc680b45f936e 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 }, -@@ -1720,6 +1721,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; - } --- -2.41.0 - - -From 469ab7efd0383f60e83c086347526273ed1d1a33 Mon Sep 17 00:00:00 2001 -From: Timothee Besset <ttimo@valvesoftware.com> -Date: Mon, 22 May 2023 20:25:57 -0500 -Subject: [PATCH 09/10] Input: xpad - Add GameSir VID for Xbox One controllers - -Co-authored-by: Sam Lantinga <saml@valvesoftware.com> -Signed-off-by: Sam Lantinga <slouken@libsdl.org> -Signed-off-by: Vicki Pfau <vi@endrift.com> ---- - drivers/input/joystick/xpad.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c -index fc680b45f936e..bb2f69faa2a81 100644 ---- a/drivers/input/joystick/xpad.c -+++ b/drivers/input/joystick/xpad.c -@@ -500,6 +500,7 @@ 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_XBOXONE_VENDOR(0x3537), /* GameSir Controllers */ - { } - }; - --- -2.41.0 - - -From 4fd74c574f8554056facabd4e36e5e397f2e6b98 Mon Sep 17 00:00:00 2001 -From: Jonathan Frederick <doublej472@gmail.com> -Date: Fri, 7 Jul 2023 15:11:33 -0700 -Subject: [PATCH 10/10] Input: xpad - add GameSir T4 Kaleid Controller support - -Add VID and PID to the xpad_device table to allow driver -to use the GameSir T4 Kaleid Controller, which is -XTYPE_XBOX360 compatible in xinput mode. - -Signed-off-by: Jonathan Frederick <doublej472@gmail.com> -Link: https://lore.kernel.org/r/ZKeKSbP3faIPv5jB@dbj-hp-flip -Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> ---- - drivers/input/joystick/xpad.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c -index bb2f69faa2a81..ede380551e55c 100644 ---- a/drivers/input/joystick/xpad.c -+++ b/drivers/input/joystick/xpad.c -@@ -366,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 } -@@ -500,6 +501,7 @@ 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 */ - { } - }; --- -2.41.0 - |