From e6cc4ef7561ad8f0900f7628d4a368d972e5a0d0 Mon Sep 17 00:00:00 2001 From: Brendon O'Laney Date: Thu, 15 Jun 2023 12:40:48 -0700 Subject: [PATCH] Add support for the XBox Elite Series 2 pad I'm not sure how my device is different from the XBox One Elite Series 2, but the identifiers are different and it's giving me a hard time with a downstream project. The name I gave it is the one on the packaging. --- src/hid/hid.c | 1 + src/hid/xbox.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hid/hid.c b/src/hid/hid.c index 199f77ba..38555f6f 100644 --- a/src/hid/hid.c +++ b/src/hid/hid.c @@ -51,6 +51,7 @@ MTY_CType hid_driver(struct hid_dev *device) case 0x045E02FD: // Microsoft X-Box One S pad (Bluetooth) case 0x045E0B05: // Microsoft X-Box One Elite Series 2 pad (Bluetooth) case 0x045E0B13: // Microsoft X-Box Series X (Bluetooth) + case 0x045E0B22: // Microsoft X-Box Elite Series 2 pad (Bluetooth) return MTY_CTYPE_XBOX; // Xbox Wired diff --git a/src/hid/xbox.h b/src/hid/xbox.h index 7bcb210c..376f4c55 100644 --- a/src/hid/xbox.h +++ b/src/hid/xbox.h @@ -69,7 +69,8 @@ static void xbox_do_rumble(struct hid_dev *device) static void xbox_init(struct hid_dev *device) { struct xbox_state *ctx = mty_hid_device_get_state(device); - ctx->series_x = mty_hid_device_get_pid(device) == 0x0B13; + uint16_t device_pid = mty_hid_device_get_pid(device); + ctx->series_x = device_pid == 0x0B13 || device_pid == 0x0B22; ctx->rumble = true; }