Skip to content

Commit abf82e8

Browse files
zaps166Jiri Kosina
authored andcommitted
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: 2dc702c ("HID: input: use the Resolution Multiplier for high-resolution scrolling") Signed-off-by: Błażej Szczygieł <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 64caea5 commit abf82e8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

drivers/hid/hid-a4tech.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ static int a4_input_mapped(struct hid_device *hdev, struct hid_input *hi,
3838
{
3939
struct a4tech_sc *a4 = hid_get_drvdata(hdev);
4040

41-
if (usage->type == EV_REL && usage->code == REL_WHEEL)
41+
if (usage->type == EV_REL && usage->code == REL_WHEEL_HI_RES) {
4242
set_bit(REL_HWHEEL, *bit);
43+
set_bit(REL_HWHEEL_HI_RES, *bit);
44+
}
4345

4446
if ((a4->quirks & A4_2WHEEL_MOUSE_HACK_7) && usage->hid == 0x00090007)
4547
return -1;
@@ -60,14 +62,16 @@ static int a4_event(struct hid_device *hdev, struct hid_field *field,
6062
input = field->hidinput->input;
6163

6264
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) {
6466
a4->delayed_value = value;
6567
return 1;
6668
}
6769

6870
if (usage->hid == 0x000100b8) {
6971
input_event(input, EV_REL, value ? REL_HWHEEL :
7072
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);
7175
return 1;
7276
}
7377
}
@@ -77,8 +81,9 @@ static int a4_event(struct hid_device *hdev, struct hid_field *field,
7781
return 1;
7882
}
7983

80-
if (usage->code == REL_WHEEL && a4->hw_wheel) {
84+
if (usage->code == REL_WHEEL_HI_RES && a4->hw_wheel) {
8185
input_event(input, usage->type, REL_HWHEEL, value);
86+
input_event(input, usage->type, REL_HWHEEL_HI_RES, value * 120);
8287
return 1;
8388
}
8489

0 commit comments

Comments
 (0)