]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Aug 2024 11:46:59 +0000 (13:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Aug 2024 11:46:59 +0000 (13:46 +0200)
added patches:
hid-microsoft-add-rumble-support-to-latest-xbox-controllers.patch
hid-wacom-defer-calculation-of-resolution-until-resolution_code-is-known.patch

queue-5.4/hid-microsoft-add-rumble-support-to-latest-xbox-controllers.patch [new file with mode: 0644]
queue-5.4/hid-wacom-defer-calculation-of-resolution-until-resolution_code-is-known.patch [new file with mode: 0644]
queue-5.4/series

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 (file)
index 0000000..1fa6fda
--- /dev/null
@@ -0,0 +1,97 @@
+From f5554725f30475b05b5178b998366f11ecb50c7f Mon Sep 17 00:00:00 2001
+From: Siarhei Vishniakou <svv@google.com>
+Date: Tue, 25 Apr 2023 09:38:44 -0700
+Subject: HID: microsoft: Add rumble support to latest xbox controllers
+
+From: Siarhei Vishniakou <svv@google.com>
+
+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 <hadess@hadess.net>
+Signed-off-by: Siarhei Vishniakou <svv@google.com>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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 (file)
index 0000000..cae5208
--- /dev/null
@@ -0,0 +1,49 @@
+From 1b8f9c1fb464968a5b18d3acc1da8c00bad24fad Mon Sep 17 00:00:00 2001
+From: Jason Gerecke <jason.gerecke@wacom.com>
+Date: Tue, 30 Jul 2024 08:51:55 -0700
+Subject: HID: wacom: Defer calculation of resolution until resolution_code is known
+
+From: Jason Gerecke <jason.gerecke@wacom.com>
+
+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 <jason.gerecke@wacom.com>
+Fixes: 08a46b4190d3 ("HID: wacom: Set a default resolution for older tablets")
+Cc: stable@vger.kernel.org
+Signed-off-by: Jiri Kosina <jkosina@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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;
index 9fb4d0df5b12ae83e5d6c0e7dce632a8495e01b7..f90f67ac8f0b44c675639f96a8699ba0e74a1af3 100644 (file)
@@ -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