summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Stein <jcs@cvs.openbsd.org>2018-09-01 20:48:01 +0000
committerJoshua Stein <jcs@cvs.openbsd.org>2018-09-01 20:48:01 +0000
commit91f23a9860ecdd580c7e29d1dbf285e21fd35a18 (patch)
tree40ef4dbf47828294f69e86734eb8446216ed41c1
parent9c6d40be6ef8c6dc004464168fae1ba3b7177bd8 (diff)
For touchscreen devices, use the first HUG_X/Y usage pages found
when looking for logical min/max of screen. ok kettenis
-rw-r--r--sys/dev/hid/hidms.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/hid/hidms.c b/sys/dev/hid/hidms.c
index d5009ef9a88..30f541ebefb 100644
--- a/sys/dev/hid/hidms.c
+++ b/sys/dev/hid/hidms.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hidms.c,v 1.3 2016/05/22 22:06:11 bru Exp $ */
+/* $OpenBSD: hidms.c,v 1.4 2018/09/01 20:48:00 jcs Exp $ */
/* $NetBSD: ums.c,v 1.60 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -241,13 +241,15 @@ hidms_setup(struct device *self, struct hidms *ms, uint32_t quirks,
h.usage, h.logical_minimum, h.logical_maximum));
switch (HID_GET_USAGE(h.usage)) {
case HUG_X:
- if (ms->sc_flags & HIDMS_ABSX) {
+ if (ms->sc_flags & HIDMS_ABSX &&
+ !ms->sc_tsscale.minx && !ms->sc_tsscale.maxy) {
ms->sc_tsscale.minx = h.logical_minimum;
ms->sc_tsscale.maxx = h.logical_maximum;
}
break;
case HUG_Y:
- if (ms->sc_flags & HIDMS_ABSY) {
+ if (ms->sc_flags & HIDMS_ABSY &&
+ !ms->sc_tsscale.miny && !ms->sc_tsscale.maxy) {
ms->sc_tsscale.miny = h.logical_minimum;
ms->sc_tsscale.maxy = h.logical_maximum;
}