1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-03 06:45:37 -08:00

When walking the HID descriptor, even though we filter for hid_input

we will get hid_collection and hid_endcollection items.  Since hid_
endcollection apparently returns the usage of the previous item, it
was possible that we "see" two items for the same usage.  Make sure
that we only accept hid_input items.  Both hidms and hidkbd do some-
thing similar, fixes the Pinebook Pro's trackpad.

ok kettenis@
This commit is contained in:
patrick 2020-02-10 14:35:08 +00:00
parent db5b0f163d
commit 8945acc287

View File

@ -1,4 +1,4 @@
/* $OpenBSD: hidmt.c,v 1.10 2019/11/08 01:20:22 yasuoka Exp $ */
/* $OpenBSD: hidmt.c,v 1.11 2020/02/10 14:35:08 patrick Exp $ */
/*
* HID multitouch driver for devices conforming to Windows Precision Touchpad
* standard
@ -176,6 +176,8 @@ hidmt_setup(struct device *self, struct hidmt *mt, void *desc, int dlen)
if (h.report_ID != mt->sc_rep_input)
continue;
if (h.kind != hid_input)
continue;
switch (h.usage) {
/* contact level usages */