summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Stein <jcs@cvs.openbsd.org>2018-09-01 20:50:17 +0000
committerJoshua Stein <jcs@cvs.openbsd.org>2018-09-01 20:50:17 +0000
commita3a9d52f0538b416220d05aac66d144839d2ff9b (patch)
tree28347e505434e400eb4fa8e3882bbde197c8341d
parent91f23a9860ecdd580c7e29d1dbf285e21fd35a18 (diff)
Match on interfaces with Digitizers/Touchscreen collections, as long
as they have an X usage. Should get basic touchscreen functionality on some common HID-over-i2c devices like laptops.
-rw-r--r--sys/dev/i2c/ims.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/i2c/ims.c b/sys/dev/i2c/ims.c
index c3bc81ed84b..e74dd8554c2 100644
--- a/sys/dev/i2c/ims.c
+++ b/sys/dev/i2c/ims.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ims.c,v 1.1 2016/01/12 01:11:15 jcs Exp $ */
+/* $OpenBSD: ims.c,v 1.2 2018/09/01 20:50:16 jcs Exp $ */
/*
* HID-over-i2c mouse/trackpad driver
*
@@ -85,6 +85,12 @@ ims_match(struct device *parent, void *match, void *aux)
HID_USAGE2(HUP_DIGITIZERS, HUD_PEN)))
return (IMATCH_IFACECLASS);
+ if (hid_is_collection(desc, size, iha->reportid,
+ HID_USAGE2(HUP_DIGITIZERS, HUD_TOUCHSCREEN)) &&
+ hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X),
+ iha->reportid, hid_input, NULL, NULL))
+ return (IMATCH_IFACECLASS);
+
return (IMATCH_NONE);
}