[PATCH 1/2] Input: xpad - query MS OS descriptor for BTP-KP20D

From: Aaron Ma

Date: Sat Jul 25 2026 - 03:32:35 EST


The Beitong BTP-KP20D dongle cycles through its operating modes and
never becomes usable unless the host requests the Microsoft OS string
descriptor at index 0xee. Windows makes this request while discovering
the XUSB10 compatible ID, but Linux USB core does not query Microsoft
OS descriptors.

Add a device-specific quirk that performs the request during probe,
allowing the dongle to remain in Xbox 360 mode.

Signed-off-by: Aaron Ma <mapengyu@xxxxxxxxx>
---
drivers/input/joystick/xpad.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index feb8f368f834e..1616047e65f5e 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -72,6 +72,7 @@
#define PKT_XBE2_FW_5_11 4

#define FLAG_DELAY_INIT BIT(0)
+#define FLAG_MS_OS_DESC BIT(1)

static bool dpad_to_buttons;
module_param(dpad_to_buttons, bool, S_IRUGO);
@@ -334,6 +335,7 @@ static const struct xpad_device {
{ 0x1ee9, 0x1590, "ZOTAC Gaming Zone", 0, XTYPE_XBOX360 },
{ 0x20bc, 0x5134, "BETOP BTP-KP50B Xinput Dongle", 0, XTYPE_XBOX360 },
{ 0x20bc, 0x514a, "BETOP BTP-KP50C Xinput Dongle", 0, XTYPE_XBOX360 },
+ { 0x20bc, 0x5159, "Beitong BTP-KP20D Controller", 0, XTYPE_XBOX360, FLAG_MS_OS_DESC },
{ 0x20d6, 0x2001, "BDA Xbox Series X Wired Controller", 0, XTYPE_XBOXONE },
{ 0x20d6, 0x2009, "PowerA Enhanced Wired Controller for Xbox Series X|S", 0, XTYPE_XBOXONE },
{ 0x20d6, 0x2064, "PowerA Wired Controller for Xbox", MAP_SHARE_BUTTON, XTYPE_XBOXONE },
@@ -786,6 +788,24 @@ static int xpad_start_input(struct usb_xpad *xpad);
static void xpadone_ack_mode_report(struct usb_xpad *xpad, u8 seq_num);
static void xpad360w_poweroff_controller(struct usb_xpad *xpad);

+static void xpad_query_ms_os_descriptor(struct usb_device *udev)
+{
+ u8 *descriptor;
+ int error;
+
+ descriptor = kmalloc(18, GFP_KERNEL);
+ if (!descriptor)
+ return;
+
+ error = usb_get_descriptor(udev, USB_DT_STRING, 0xee,
+ descriptor, 18);
+ if (error != 18)
+ dev_warn(&udev->dev,
+ "unable to query MS OS descriptor: %d\n", error);
+
+ kfree(descriptor);
+}
+
/*
* xpad_process_packet
*
@@ -2055,6 +2075,9 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
break;
}

+ if (xpad_device[i].flags & FLAG_MS_OS_DESC)
+ xpad_query_ms_os_descriptor(udev);
+
xpad = kzalloc_obj(*xpad);
if (!xpad)
return -ENOMEM;
--
2.53.0