From f320308cc2368ecbbecc04b9caf0f74523c62ab0 Mon Sep 17 00:00:00 2001 From: jcs Date: Sat, 1 Sep 2018 20:50:16 +0000 Subject: [PATCH] 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. --- sys/dev/i2c/ims.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); } -- 2.20.1