From: Greg Kroah-Hartman Date: Sat, 13 May 2023 07:52:11 +0000 (+0900) Subject: 4.14-stable patches X-Git-Tag: v4.14.315~81 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e7e5de75e71aff26e420e2a8f0452adb8032d746;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: hid-wacom-set-a-default-resolution-for-older-tablets.patch --- diff --git a/queue-4.14/hid-wacom-set-a-default-resolution-for-older-tablets.patch b/queue-4.14/hid-wacom-set-a-default-resolution-for-older-tablets.patch new file mode 100644 index 00000000000..1c6feaed2a9 --- /dev/null +++ b/queue-4.14/hid-wacom-set-a-default-resolution-for-older-tablets.patch @@ -0,0 +1,48 @@ +From 08a46b4190d345544d04ce4fe2e1844b772b8535 Mon Sep 17 00:00:00 2001 +From: Ping Cheng +Date: Sun, 9 Apr 2023 09:42:29 -0700 +Subject: HID: wacom: Set a default resolution for older tablets + +From: Ping Cheng + +commit 08a46b4190d345544d04ce4fe2e1844b772b8535 upstream. + +Some older tablets may not report physical maximum for X/Y +coordinates. Set a default to prevent undefined resolution. + +Signed-off-by: Ping Cheng +Link: https://lore.kernel.org/r/20230409164229.29777-1-ping.cheng@wacom.com +Signed-off-by: Benjamin Tissoires +Signed-off-by: Greg Kroah-Hartman +--- + drivers/hid/wacom_wac.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +--- a/drivers/hid/wacom_wac.c ++++ b/drivers/hid/wacom_wac.c +@@ -1734,6 +1734,7 @@ 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); + + if (equivalent_usage == HID_DG_TWIST) { + resolution_code = ABS_RZ; +@@ -1756,8 +1757,15 @@ static void wacom_map_usage(struct input + switch (type) { + case EV_ABS: + input_set_abs_params(input, code, fmin, fmax, fuzz, 0); +- input_abs_set_res(input, code, +- hidinput_calc_abs_res(field, resolution_code)); ++ ++ /* older tablet may miss physical usage */ ++ if ((code == ABS_X || code == ABS_Y) && !resolution) { ++ resolution = WACOM_INTUOS_RES; ++ hid_warn(input, ++ "Wacom usage (%d) missing resolution \n", ++ code); ++ } ++ input_abs_set_res(input, code, resolution); + break; + case EV_KEY: + input_set_capability(input, EV_KEY, code); diff --git a/queue-4.14/series b/queue-4.14/series index f6929525c66..009d5d26887 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -101,3 +101,4 @@ sh-math-emu-fix-macro-redefined-warning.patch sh-nmi_debug-fix-return-value-of-__setup-handler.patch arm-dts-exynos-fix-wm8960-clock-name-in-itop-elite.patch arm-dts-s5pv210-correct-mipi-csis-clock-name.patch +hid-wacom-set-a-default-resolution-for-older-tablets.patch