From 8945acc287c32d5270939c2b49dfd9022ee4fdd4 Mon Sep 17 00:00:00 2001 From: patrick Date: Mon, 10 Feb 2020 14:35:08 +0000 Subject: [PATCH] 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@ --- sys/dev/hid/hidmt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/hid/hidmt.c b/sys/dev/hid/hidmt.c index 1a577360924..532da1b6627 100644 --- a/sys/dev/hid/hidmt.c +++ b/sys/dev/hid/hidmt.c @@ -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 */