HID: logitech: Handle 0 scroll events for the m560

hidpp_scroll_counter_handle_scroll() doesn't expect a 0-value scroll event, it
gets interpreted as a negative scroll direction event. This can cause scroll
direction resets and thus broken scrolling.

Fixes: 4435ff2f09 ("HID: logitech: Enable high-resolution scrolling on Logitech mice")
Cc: stable@vger.kernel.org # v5.0
Reported-and-tested-by: Aimo Metsälä <aimetsal@outlook.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
This commit is contained in:
Peter Hutterer 2019-03-20 08:48:23 +10:00 committed by Benjamin Tissoires
parent cef0d4948c
commit fd35759ce3

View File

@ -2614,6 +2614,7 @@ static int m560_raw_event(struct hid_device *hdev, u8 *data, int size)
input_report_rel(mydata->input, REL_Y, v);
v = hid_snto32(data[6], 8);
if (v != 0)
hidpp_scroll_counter_handle_scroll(
&hidpp->vertical_wheel_counter, v);