From: Greg Kroah-Hartman Date: Mon, 26 Aug 2024 11:46:59 +0000 (+0200) Subject: 5.4-stable patches X-Git-Tag: v6.1.107~50 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=08852f8604fd2ddc15b0f1b7afc638062f51c034;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: hid-microsoft-add-rumble-support-to-latest-xbox-controllers.patch hid-wacom-defer-calculation-of-resolution-until-resolution_code-is-known.patch --- diff --git a/queue-5.4/hid-microsoft-add-rumble-support-to-latest-xbox-controllers.patch b/queue-5.4/hid-microsoft-add-rumble-support-to-latest-xbox-controllers.patch new file mode 100644 index 00000000000..1fa6fda7d68 --- /dev/null +++ b/queue-5.4/hid-microsoft-add-rumble-support-to-latest-xbox-controllers.patch @@ -0,0 +1,97 @@ +From f5554725f30475b05b5178b998366f11ecb50c7f Mon Sep 17 00:00:00 2001 +From: Siarhei Vishniakou +Date: Tue, 25 Apr 2023 09:38:44 -0700 +Subject: HID: microsoft: Add rumble support to latest xbox controllers + +From: Siarhei Vishniakou + +commit f5554725f30475b05b5178b998366f11ecb50c7f upstream. + +Currently, rumble is only supported via bluetooth on a single xbox +controller, called 'model 1708'. On the back of the device, it's named +'wireless controller for xbox one'. However, in 2021, Microsoft released +a firmware update for this controller. As part of this update, the HID +descriptor of the device changed. The product ID was also changed from +0x02fd to 0x0b20. On this controller, rumble was supported via +hid-microsoft, which matched against the old product id (0x02fd). As a +result, the firmware update broke rumble support on this controller. + +See: +https://news.xbox.com/en-us/2021/09/08/xbox-controller-firmware-update-rolling-out-to-insiders-starting-today/ + +The hid-microsoft driver actually supports rumble on the new firmware, +as well. So simply adding new product id is sufficient to bring back +this support. + +After discussing further with the xbox team, it was pointed out that +another xbox controller, xbox elite series 2, can be supported in a +similar way. + +Add rumble support for all of these devices in this patch. Two of the +devices have received firmware updates that caused their product id's to +change. Both old and new firmware versions of these devices were tested. + +The tested controllers are: + +1. 'wireless controller for xbox one', model 1708 +2. 'xbox wireless controller', model 1914. This is also sometimes + referred to as 'xbox series S|X'. +3. 'elite series 2', model 1797. + +The tested configurations are: +1. model 1708, pid 0x02fd (old firmware) +2. model 1708, pid 0x0b20 (new firmware) +3. model 1914, pid 0x0b13 +4. model 1797, pid 0x0b05 (old firmware) +5. model 1797, pid 0x0b22 (new firmware) + +I verified rumble support on both bluetooth and usb. + +Reviewed-by: Bastien Nocera +Signed-off-by: Siarhei Vishniakou +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman +--- + drivers/hid/hid-ids.h | 10 +++++++++- + drivers/hid/hid-microsoft.c | 11 ++++++++++- + 2 files changed, 19 insertions(+), 2 deletions(-) + +--- a/drivers/hid/hid-ids.h ++++ b/drivers/hid/hid-ids.h +@@ -866,7 +866,15 @@ + #define USB_DEVICE_ID_MS_TYPE_COVER_2 0x07a9 + #define USB_DEVICE_ID_MS_POWER_COVER 0x07da + #define USB_DEVICE_ID_MS_SURFACE3_COVER 0x07de +-#define USB_DEVICE_ID_MS_XBOX_ONE_S_CONTROLLER 0x02fd ++/* ++ * For a description of the Xbox controller models, refer to: ++ * https://en.wikipedia.org/wiki/Xbox_Wireless_Controller#Summary ++ */ ++#define USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1708 0x02fd ++#define USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1708_BLE 0x0b20 ++#define USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1914 0x0b13 ++#define USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1797 0x0b05 ++#define USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1797_BLE 0x0b22 + #define USB_DEVICE_ID_MS_PIXART_MOUSE 0x00cb + #define USB_DEVICE_ID_8BITDO_SN30_PRO_PLUS 0x02e0 + #define USB_DEVICE_ID_MS_MOUSE_0783 0x0783 +--- a/drivers/hid/hid-microsoft.c ++++ b/drivers/hid/hid-microsoft.c +@@ -449,7 +449,16 @@ static const struct hid_device_id ms_dev + .driver_data = MS_PRESENTER }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, 0x091B), + .driver_data = MS_SURFACE_DIAL }, +- { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_ONE_S_CONTROLLER), ++ ++ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1708), ++ .driver_data = MS_QUIRK_FF }, ++ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1708_BLE), ++ .driver_data = MS_QUIRK_FF }, ++ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1914), ++ .driver_data = MS_QUIRK_FF }, ++ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1797), ++ .driver_data = MS_QUIRK_FF }, ++ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1797_BLE), + .driver_data = MS_QUIRK_FF }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_8BITDO_SN30_PRO_PLUS), + .driver_data = MS_QUIRK_FF }, diff --git a/queue-5.4/hid-wacom-defer-calculation-of-resolution-until-resolution_code-is-known.patch b/queue-5.4/hid-wacom-defer-calculation-of-resolution-until-resolution_code-is-known.patch new file mode 100644 index 00000000000..cae5208bda9 --- /dev/null +++ b/queue-5.4/hid-wacom-defer-calculation-of-resolution-until-resolution_code-is-known.patch @@ -0,0 +1,49 @@ +From 1b8f9c1fb464968a5b18d3acc1da8c00bad24fad Mon Sep 17 00:00:00 2001 +From: Jason Gerecke +Date: Tue, 30 Jul 2024 08:51:55 -0700 +Subject: HID: wacom: Defer calculation of resolution until resolution_code is known + +From: Jason Gerecke + +commit 1b8f9c1fb464968a5b18d3acc1da8c00bad24fad upstream. + +The Wacom driver maps the HID_DG_TWIST usage to ABS_Z (rather than ABS_RZ) +for historic reasons. When the code to support twist was introduced in +commit 50066a042da5 ("HID: wacom: generic: Add support for height, tilt, +and twist usages"), we were careful to write it in such a way that it had +HID calculate the resolution of the twist axis assuming ABS_RZ instead +(so that we would get correct angular behavior). This was broken with +the introduction of commit 08a46b4190d3 ("HID: wacom: Set a default +resolution for older tablets"), which moved the resolution calculation +to occur *before* the adjustment from ABS_Z to ABS_RZ occurred. + +This commit moves the calculation of resolution after the point that +we are finished setting things up for its proper use. + +Signed-off-by: Jason Gerecke +Fixes: 08a46b4190d3 ("HID: wacom: Set a default resolution for older tablets") +Cc: stable@vger.kernel.org +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman +--- + drivers/hid/wacom_wac.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/hid/wacom_wac.c ++++ b/drivers/hid/wacom_wac.c +@@ -1920,12 +1920,14 @@ static void wacom_map_usage(struct input + int fmax = field->logical_maximum; + unsigned int equivalent_usage = wacom_equivalent_usage(usage->hid); + int resolution_code = code; +- int resolution = hidinput_calc_abs_res(field, resolution_code); ++ int resolution; + + if (equivalent_usage == HID_DG_TWIST) { + resolution_code = ABS_RZ; + } + ++ resolution = hidinput_calc_abs_res(field, resolution_code); ++ + if (equivalent_usage == HID_GD_X) { + fmin += features->offset_left; + fmax -= features->offset_right; diff --git a/queue-5.4/series b/queue-5.4/series index 9fb4d0df5b1..f90f67ac8f0 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -98,3 +98,5 @@ drm-msm-use-drm_debug_enabled-to-check-for-debug-cat.patch drm-msm-dpu-don-t-play-tricks-with-debug-macros.patch mmc-mmc_test-fix-null-dereference-on-allocation-fail.patch bluetooth-mgmt-add-error-handling-to-pair_device.patch +hid-wacom-defer-calculation-of-resolution-until-resolution_code-is-known.patch +hid-microsoft-add-rumble-support-to-latest-xbox-controllers.patch