summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBłażej Szczygieł <spaz16@wp.pl>2019-05-12 16:33:13 -0400
committerJiri Kosina <jkosina@suse.cz>2019-05-31 18:27:31 -0400
commitabf82e8f7e9af40a49e3d905187c662a43c96c8f (patch)
treebdbd305e951f82989182fbd466322aac37c2211b
parent64caea53e07f0a3bc4af74f4123b258c1ceb4d67 (diff)
HID: a4tech: fix horizontal scrolling
Since recent high resolution scrolling changes the A4Tech driver must check for the "REL_WHEEL_HI_RES" usage code. Link: https://bugzilla.kernel.org/show_bug.cgi?id=203369 Fixes: 2dc702c991e3774af9d7ce410eef410ca9e2357e ("HID: input: use the Resolution Multiplier for high-resolution scrolling") Signed-off-by: Błażej Szczygieł <spaz16@wp.pl> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/hid-a4tech.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/hid/hid-a4tech.c b/drivers/hid/hid-a4tech.c
index 9428ea7cdf8a..c3a6ce3613fe 100644
--- a/drivers/hid/hid-a4tech.c
+++ b/drivers/hid/hid-a4tech.c
@@ -38,8 +38,10 @@ static int a4_input_mapped(struct hid_device *hdev, struct hid_input *hi,
38{ 38{
39 struct a4tech_sc *a4 = hid_get_drvdata(hdev); 39 struct a4tech_sc *a4 = hid_get_drvdata(hdev);
40 40
41 if (usage->type == EV_REL && usage->code == REL_WHEEL) 41 if (usage->type == EV_REL && usage->code == REL_WHEEL_HI_RES) {
42 set_bit(REL_HWHEEL, *bit); 42 set_bit(REL_HWHEEL, *bit);
43 set_bit(REL_HWHEEL_HI_RES, *bit);
44 }
43 45
44 if ((a4->quirks & A4_2WHEEL_MOUSE_HACK_7) && usage->hid == 0x00090007) 46 if ((a4->quirks & A4_2WHEEL_MOUSE_HACK_7) && usage->hid == 0x00090007)
45 return -1; 47 return -1;
@@ -60,7 +62,7 @@ static int a4_event(struct hid_device *hdev, struct hid_field *field,
60 input = field->hidinput->input; 62 input = field->hidinput->input;
61 63
62 if (a4->quirks & A4_2WHEEL_MOUSE_HACK_B8) { 64 if (a4->quirks & A4_2WHEEL_MOUSE_HACK_B8) {
63 if (usage->type == EV_REL && usage->code == REL_WHEEL) { 65 if (usage->type == EV_REL && usage->code == REL_WHEEL_HI_RES) {
64 a4->delayed_value = value; 66 a4->delayed_value = value;
65 return 1; 67 return 1;
66 } 68 }
@@ -68,6 +70,8 @@ static int a4_event(struct hid_device *hdev, struct hid_field *field,
68 if (usage->hid == 0x000100b8) { 70 if (usage->hid == 0x000100b8) {
69 input_event(input, EV_REL, value ? REL_HWHEEL : 71 input_event(input, EV_REL, value ? REL_HWHEEL :
70 REL_WHEEL, a4->delayed_value); 72 REL_WHEEL, a4->delayed_value);
73 input_event(input, EV_REL, value ? REL_HWHEEL_HI_RES :
74 REL_WHEEL_HI_RES, a4->delayed_value * 120);
71 return 1; 75 return 1;
72 } 76 }
73 } 77 }
@@ -77,8 +81,9 @@ static int a4_event(struct hid_device *hdev, struct hid_field *field,
77 return 1; 81 return 1;
78 } 82 }
79 83
80 if (usage->code == REL_WHEEL && a4->hw_wheel) { 84 if (usage->code == REL_WHEEL_HI_RES && a4->hw_wheel) {
81 input_event(input, usage->type, REL_HWHEEL, value); 85 input_event(input, usage->type, REL_HWHEEL, value);
86 input_event(input, usage->type, REL_HWHEEL_HI_RES, value * 120);
82 return 1; 87 return 1;
83 } 88 }
84 89