[linux 7.1.y] Add BEITONG KP Series Support - #2025
Conversation
The BEITONG KP Series Support added latest BTP-KP70C NTE Edition
Reviewer's GuideAdds support for multiple BEITONG KP-series Xbox360-compatible controllers, including special handling to read the XUSB10 Microsoft feature descriptor on probe, and introduces a small HID receiver driver plus custom init/exit to register both USB and HID drivers. Sequence diagram for XUSB10 descriptor read during xpad_probesequenceDiagram
participant USBCore as USB_core
participant xpad_driver
participant usb_xpad
participant usb_device as udev
USBCore->>xpad_driver: xpad_probe(intf, id)
xpad_driver->>xpad_driver: allocate usb_xpad
xpad_driver->>usb_xpad: set read_xusb10 based on FLAG_READ_XUSB10
xpad_driver->>usb_xpad: usb_submit_urb(xpad->irq_in)
xpad_driver->>USBCore: usb_set_intfdata(intf, xpad)
opt [xpad->read_xusb10]
xpad_driver->>udev: usb_control_msg_recv(0, 0xee, 0x0000, 0x0004, ms_feature_descriptor, sizeof(ms_feature_descriptor), 25)
alt [error]
xpad_driver->>USBCore: dev_warn(intf->dev, unable to read Microsoft feature descriptor)
end
end
xpad_driver-->>USBCore: return probe result
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Hi @EvernightFedora. Thanks for your PR. 😃 |
|
Hi @EvernightFedora. Thanks for your PR. I'm waiting for a deepin-community member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- Consider adding a short comment near FLAG_READ_XUSB10 / usb_control_msg_recv() explaining why reading the XUSB10 feature descriptor is required for these devices, since the magic request values (0xee, 0x0004, 40 bytes) aren’t otherwise obvious.
- The optional Microsoft feature descriptor read currently logs a dev_warn() on failure; if this read is purely advisory/quirk-triggering, switching to dev_dbg() or gating the warning behind a one-time message could avoid noisy logs on devices where this is expected to fail.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider adding a short comment near FLAG_READ_XUSB10 / usb_control_msg_recv() explaining why reading the XUSB10 feature descriptor is required for these devices, since the magic request values (0xee, 0x0004, 40 bytes) aren’t otherwise obvious.
- The optional Microsoft feature descriptor read currently logs a dev_warn() on failure; if this read is purely advisory/quirk-triggering, switching to dev_dbg() or gating the warning behind a one-time message could avoid noisy logs on devices where this is expected to fail.
## Individual Comments
### Comment 1
<location path="drivers/input/joystick/xpad.c" line_range="2391" />
<code_context>
+}
+
+static const struct hid_device_id xpad_receiver_devices[] = {
+ { HID_USB_DEVICE(0x20dd, 0x515c) },
+ { }
+};
</code_context>
<issue_to_address>
**question (bug_risk):** Double-check the HID receiver VID/PID for consistency with the USB IDs above
The HID receiver entry uses VID 0x20dd / PID 0x515c, but the related BEITONG/BETOP USB xpad entries use VID 0x20bc with 0x515x PIDs. Please verify this VID against the actual receiver descriptor; if it was meant to be 0x20bc, correcting it now will prevent a runtime mismatch where the dongle is not bound correctly.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| } | ||
|
|
||
| static const struct hid_device_id xpad_receiver_devices[] = { | ||
| { HID_USB_DEVICE(0x20dd, 0x515c) }, |
There was a problem hiding this comment.
question (bug_risk): Double-check the HID receiver VID/PID for consistency with the USB IDs above
The HID receiver entry uses VID 0x20dd / PID 0x515c, but the related BEITONG/BETOP USB xpad entries use VID 0x20bc with 0x515x PIDs. Please verify this VID against the actual receiver descriptor; if it was meant to be 0x20bc, correcting it now will prevent a runtime mismatch where the dongle is not bound correctly.
There was a problem hiding this comment.
Pull request overview
This PR extends the xpad driver to recognize additional BEITONG KP-series Xbox-compatible controllers, adds a probe-time read of the Microsoft XUSB10 feature descriptor for selected devices, and introduces a small HID driver intended to handle a BEITONG wireless receiver device ID. It also refactors module init/exit to explicitly register both the USB and (optionally) HID drivers.
Changes:
- Add many new BEITONG KP-series USB IDs to the
xpaddevice table, gated with a newFLAG_READ_XUSB10. - During
xpad_probe(), optionally issue a vendor control request (0xee) to read the Microsoft feature descriptor for devices marked withFLAG_READ_XUSB10. - Add/register a minimal HID driver for a BEITONG receiver and refactor initialization to register/unregister both USB and HID drivers.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| error = hid_parse(hdev); | ||
| if (error) | ||
| return error; | ||
|
|
||
| error = hid_hw_start(hdev, 0); | ||
| if (error) | ||
| return error; |
|
请按别的提交的格式修改commit message |
The BEITONG KP Series Support added latest BTP-KP70C NTE Edition device id.On the Evernight Vista 44.0.1 RTM,the changes can BEITONG KP Series never disconnect and Support NTE Edition Game Controller.
Summary by Sourcery
Add support for additional BEITONG KP-series Xbox-compatible controllers and their wireless receiver to the xpad driver, including required descriptor handling and driver registration changes.
New Features:
Enhancements: