]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 May 2023 18:45:48 +0000 (19:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 May 2023 18:45:48 +0000 (19:45 +0100)
added patches:
hid-wacom-add-new-intuos-pro-small-pth-460-device-ids.patch
hid-wacom-add-three-styli-to-wacom_intuos_get_tool_type.patch
hid-wacom-force-pen-out-of-prox-if-no-events-have-been-received-in-a-while.patch

queue-5.10/hid-wacom-add-new-intuos-pro-small-pth-460-device-ids.patch [new file with mode: 0644]
queue-5.10/hid-wacom-add-three-styli-to-wacom_intuos_get_tool_type.patch [new file with mode: 0644]
queue-5.10/hid-wacom-force-pen-out-of-prox-if-no-events-have-been-received-in-a-while.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/hid-wacom-add-new-intuos-pro-small-pth-460-device-ids.patch b/queue-5.10/hid-wacom-add-new-intuos-pro-small-pth-460-device-ids.patch
new file mode 100644 (file)
index 0000000..fca16ac
--- /dev/null
@@ -0,0 +1,41 @@
+From 0627f3df95e1609693f89e7ceb4156ac5db6e358 Mon Sep 17 00:00:00 2001
+From: Ping Cheng <pinglinux@gmail.com>
+Date: Fri, 26 Aug 2022 14:34:02 -0700
+Subject: HID: wacom: Add new Intuos Pro Small (PTH-460) device IDs
+
+From: Ping Cheng <pinglinux@gmail.com>
+
+commit 0627f3df95e1609693f89e7ceb4156ac5db6e358 upstream.
+
+Add the new PIDs to wacom_wac.c to support the new model in the Intuos Pro series.
+
+Signed-off-by: Ping Cheng <ping.cheng@wacom.com>
+Tested-by: Aaron Armstrong Skomra <aaron.skomra@wacom.com>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Cc: Ping Cheng <pinglinux@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/hid/wacom_wac.c |    5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/drivers/hid/wacom_wac.c
++++ b/drivers/hid/wacom_wac.c
+@@ -4840,6 +4840,10 @@ static const struct wacom_features wacom
+ static const struct wacom_features wacom_features_0x3c8 =
+       { "Wacom Intuos BT M", 21600, 13500, 4095, 63,
+         INTUOSHT3_BT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 };
++static const struct wacom_features wacom_features_0x3dd =
++      { "Wacom Intuos Pro S", 31920, 19950, 8191, 63,
++        INTUOSP2S_BT, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 7,
++        .touch_max = 10 };
+ static const struct wacom_features wacom_features_HID_ANY_ID =
+       { "Wacom HID", .type = HID_GENERIC, .oVid = HID_ANY_ID, .oPid = HID_ANY_ID };
+@@ -5019,6 +5023,7 @@ const struct hid_device_id wacom_ids[] =
+       { BT_DEVICE_WACOM(0x393) },
+       { BT_DEVICE_WACOM(0x3c6) },
+       { BT_DEVICE_WACOM(0x3c8) },
++      { BT_DEVICE_WACOM(0x3dd) },
+       { USB_DEVICE_WACOM(0x4001) },
+       { USB_DEVICE_WACOM(0x4004) },
+       { USB_DEVICE_WACOM(0x5000) },
diff --git a/queue-5.10/hid-wacom-add-three-styli-to-wacom_intuos_get_tool_type.patch b/queue-5.10/hid-wacom-add-three-styli-to-wacom_intuos_get_tool_type.patch
new file mode 100644 (file)
index 0000000..f786f53
--- /dev/null
@@ -0,0 +1,36 @@
+From bfdc750c4cb2f3461b9b00a2755e2145ac195c9a Mon Sep 17 00:00:00 2001
+From: Ping Cheng <pinglinux@gmail.com>
+Date: Wed, 28 Sep 2022 13:49:29 -0700
+Subject: HID: wacom: add three styli to wacom_intuos_get_tool_type
+
+From: Ping Cheng <pinglinux@gmail.com>
+
+commit bfdc750c4cb2f3461b9b00a2755e2145ac195c9a upstream.
+
+We forgot to add the 3D pen ID a year ago. There are two new pro pen
+IDs to be added.
+
+Signed-off-by: Ping Cheng <ping.cheng@wacom.com>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/hid/wacom_wac.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/hid/wacom_wac.c
++++ b/drivers/hid/wacom_wac.c
+@@ -713,11 +713,14 @@ static int wacom_intuos_get_tool_type(in
+       case 0x802: /* Intuos4/5 13HD/24HD General Pen */
+       case 0x8e2: /* IntuosHT2 pen */
+       case 0x022:
++      case 0x200: /* Pro Pen 3 */
++      case 0x04200: /* Pro Pen 3 */
+       case 0x10842: /* MobileStudio Pro Pro Pen slim */
+       case 0x14802: /* Intuos4/5 13HD/24HD Classic Pen */
+       case 0x16802: /* Cintiq 13HD Pro Pen */
+       case 0x18802: /* DTH2242 Pen */
+       case 0x10802: /* Intuos4/5 13HD/24HD General Pen */
++      case 0x80842: /* Intuos Pro and Cintiq Pro 3D Pen */
+               tool_type = BTN_TOOL_PEN;
+               break;
diff --git a/queue-5.10/hid-wacom-force-pen-out-of-prox-if-no-events-have-been-received-in-a-while.patch b/queue-5.10/hid-wacom-force-pen-out-of-prox-if-no-events-have-been-received-in-a-while.patch
new file mode 100644 (file)
index 0000000..6d3d9c2
--- /dev/null
@@ -0,0 +1,133 @@
+From 94b179052f95c294d83e9c9c34f7833cf3cd4305 Mon Sep 17 00:00:00 2001
+From: Jason Gerecke <killertofu@gmail.com>
+Date: Fri, 15 Jul 2022 16:05:19 -0700
+Subject: HID: wacom: Force pen out of prox if no events have been received in a while
+
+From: Jason Gerecke <killertofu@gmail.com>
+
+commit 94b179052f95c294d83e9c9c34f7833cf3cd4305 upstream.
+
+Prox-out events may not be reliably sent by some AES firmware. This can
+cause problems for users, particularly due to arbitration logic disabling
+touch input while the pen is in prox.
+
+This commit adds a timer which is reset every time a new prox event is
+received. When the timer expires we check to see if the pen is still in
+prox and force it out if necessary. This is patterend off of the same
+solution used by 'hid-letsketch' driver which has a similar problem.
+
+Link: https://github.com/linuxwacom/input-wacom/issues/310
+Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Cc: Ping Cheng <pinglinux@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/hid/wacom.h     |    3 +++
+ drivers/hid/wacom_sys.c |    2 ++
+ drivers/hid/wacom_wac.c |   39 +++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 44 insertions(+)
+
+--- a/drivers/hid/wacom.h
++++ b/drivers/hid/wacom.h
+@@ -91,6 +91,7 @@
+ #include <linux/leds.h>
+ #include <linux/usb/input.h>
+ #include <linux/power_supply.h>
++#include <linux/timer.h>
+ #include <asm/unaligned.h>
+ /*
+@@ -167,6 +168,7 @@ struct wacom {
+       struct delayed_work init_work;
+       struct wacom_remote *remote;
+       struct work_struct mode_change_work;
++      struct timer_list idleprox_timer;
+       bool generic_has_leds;
+       struct wacom_leds {
+               struct wacom_group_leds *groups;
+@@ -239,4 +241,5 @@ struct wacom_led *wacom_led_find(struct
+ struct wacom_led *wacom_led_next(struct wacom *wacom, struct wacom_led *cur);
+ int wacom_equivalent_usage(int usage);
+ int wacom_initialize_leds(struct wacom *wacom);
++void wacom_idleprox_timeout(struct timer_list *list);
+ #endif
+--- a/drivers/hid/wacom_sys.c
++++ b/drivers/hid/wacom_sys.c
+@@ -2781,6 +2781,7 @@ static int wacom_probe(struct hid_device
+       INIT_WORK(&wacom->battery_work, wacom_battery_work);
+       INIT_WORK(&wacom->remote_work, wacom_remote_work);
+       INIT_WORK(&wacom->mode_change_work, wacom_mode_change_work);
++      timer_setup(&wacom->idleprox_timer, &wacom_idleprox_timeout, TIMER_DEFERRABLE);
+       /* ask for the report descriptor to be loaded by HID */
+       error = hid_parse(hdev);
+@@ -2825,6 +2826,7 @@ static void wacom_remove(struct hid_devi
+       cancel_work_sync(&wacom->battery_work);
+       cancel_work_sync(&wacom->remote_work);
+       cancel_work_sync(&wacom->mode_change_work);
++      del_timer_sync(&wacom->idleprox_timer);
+       if (hdev->bus == BUS_BLUETOOTH)
+               device_remove_file(&hdev->dev, &dev_attr_speed);
+--- a/drivers/hid/wacom_wac.c
++++ b/drivers/hid/wacom_wac.c
+@@ -11,6 +11,7 @@
+ #include "wacom_wac.h"
+ #include "wacom.h"
+ #include <linux/input/mt.h>
++#include <linux/jiffies.h>
+ /* resolution for penabled devices */
+ #define WACOM_PL_RES          20
+@@ -41,6 +42,43 @@ static int wacom_numbered_button_to_key(
+ static void wacom_update_led(struct wacom *wacom, int button_count, int mask,
+                            int group);
++
++static void wacom_force_proxout(struct wacom_wac *wacom_wac)
++{
++      struct input_dev *input = wacom_wac->pen_input;
++
++      wacom_wac->shared->stylus_in_proximity = 0;
++
++      input_report_key(input, BTN_TOUCH, 0);
++      input_report_key(input, BTN_STYLUS, 0);
++      input_report_key(input, BTN_STYLUS2, 0);
++      input_report_key(input, BTN_STYLUS3, 0);
++      input_report_key(input, wacom_wac->tool[0], 0);
++      if (wacom_wac->serial[0]) {
++              input_report_abs(input, ABS_MISC, 0);
++      }
++      input_report_abs(input, ABS_PRESSURE, 0);
++
++      wacom_wac->tool[0] = 0;
++      wacom_wac->id[0] = 0;
++      wacom_wac->serial[0] = 0;
++
++      input_sync(input);
++}
++
++void wacom_idleprox_timeout(struct timer_list *list)
++{
++      struct wacom *wacom = from_timer(wacom, list, idleprox_timer);
++      struct wacom_wac *wacom_wac = &wacom->wacom_wac;
++
++      if (!wacom_wac->hid_data.sense_state) {
++              return;
++      }
++
++      hid_warn(wacom->hdev, "%s: tool appears to be hung in-prox. forcing it out.\n", __func__);
++      wacom_force_proxout(wacom_wac);
++}
++
+ /*
+  * Percent of battery capacity for Graphire.
+  * 8th value means AC online and show 100% capacity.
+@@ -2328,6 +2366,7 @@ static void wacom_wac_pen_event(struct h
+               value = field->logical_maximum - value;
+               break;
+       case HID_DG_INRANGE:
++              mod_timer(&wacom->idleprox_timer, jiffies + msecs_to_jiffies(100));
+               wacom_wac->hid_data.inrange_state = value;
+               if (!(features->quirks & WACOM_QUIRK_SENSE))
+                       wacom_wac->hid_data.sense_state = value;
index 5eb66e41f60e4e6e0a942182d3a468e2505b520d..cdeb40be966742870883c870f2cfdd7c7f8f7749 100644 (file)
@@ -147,3 +147,6 @@ ceph-force-updating-the-msg-pointer-in-non-split-case.patch
 tpm-tpm_tis-disable-interrupts-for-more-lenovo-devices.patch
 powerpc-64s-radix-fix-soft-dirty-tracking.patch
 nilfs2-fix-use-after-free-bug-of-nilfs_root-in-nilfs_evict_inode.patch
+hid-wacom-force-pen-out-of-prox-if-no-events-have-been-received-in-a-while.patch
+hid-wacom-add-new-intuos-pro-small-pth-460-device-ids.patch
+hid-wacom-add-three-styli-to-wacom_intuos_get_tool_type.patch