Skip to content

Commit

Permalink
xpadneo: Add XBE2 firmware 5.13 support
Browse files Browse the repository at this point in the history
Closes: #338
See-also: #344
Signed-off-by: Kai Krakow <[email protected]>
  • Loading branch information
kakra committed May 26, 2022
1 parent 2cfba0e commit 5845ca4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions hid-xpadneo/etc-modprobe.d/xpadneo.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ alias hid:b0005g*v0000045Ep000002FD hid_xpadneo
alias hid:b0005g*v0000045Ep00000B05 hid_xpadneo
alias hid:b0005g*v0000045Ep00000B13 hid_xpadneo
alias hid:b0005g*v0000045Ep00000B20 hid_xpadneo
alias hid:b0005g*v0000045Ep00000B22 hid_xpadneo
2 changes: 1 addition & 1 deletion hid-xpadneo/etc-udev-rules.d/60-xpadneo.rules
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ACTION=="add", KERNEL=="0005:045E:02FD.*|0005:045E:02E0.*|0005:045E:0B05.*|0005:045E:0B13.*|0005:045E:0B20.*", SUBSYSTEM=="hid", DRIVER!="xpadneo", ATTR{driver/unbind}="%k", ATTR{[drivers/hid:xpadneo]bind}="%k"
ACTION=="add", KERNEL=="0005:045E:02FD.*|0005:045E:02E0.*|0005:045E:0B05.*|0005:045E:0B13.*|0005:045E:0B20.*|0005:045E:0B22.*", SUBSYSTEM=="hid", DRIVER!="xpadneo", ATTR{driver/unbind}="%k", ATTR{[drivers/hid:xpadneo]bind}="%k"
ACTION=="add|change", DRIVERS=="xpadneo", SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="1", TAG+="uaccess", MODE="0664", ENV{LIBINPUT_IGNORE_DEVICE}="1"
11 changes: 9 additions & 2 deletions hid-xpadneo/src/hid-xpadneo.c
Original file line number Diff line number Diff line change
Expand Up @@ -848,15 +848,20 @@ static int xpadneo_raw_event(struct hid_device *hdev, struct hid_report *report,
}

/* XBE2: track the current controller settings */
if (report->id == 1 && reportsize >= 21) {
if (report->id == 1 && reportsize >= 20) {
if (reportsize == 55) {
hid_notice_once(hdev,
"detected broken XBE2 v1 packet format, please update the firmware");
xpadneo_switch_profile(xdata, data[35] & 0x03, false);
xpadneo_switch_triggers(xdata, data[36] & 0x0F);
} else {
} else if (reportsize >= 21) {
/* firmware 4.x style packet */
xpadneo_switch_profile(xdata, data[19] & 0x03, false);
xpadneo_switch_triggers(xdata, data[20] & 0x0F);
} else {
/* firmware 5.x style packet */
xpadneo_switch_profile(xdata, data[17] & 0x03, false);
xpadneo_switch_triggers(xdata, data[18] & 0x0F);
}
}

Expand Down Expand Up @@ -1198,6 +1203,8 @@ static const struct hid_device_id xpadneo_devices[] = {
/* XBOX ONE Elite Series 2 */
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, 0x0B05),
.driver_data = XPADNEO_QUIRK_USE_HW_PROFILES },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, 0x0B22),
.driver_data = XPADNEO_QUIRK_USE_HW_PROFILES | XPADNEO_QUIRK_SHARE_BUTTON },

/* XBOX Series X|S / Xbox Wireless Controller (BLE) */
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, 0x0B13),
Expand Down

0 comments on commit 5845ca4

Please sign in to comment.