summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Glocker <mglocker@cvs.openbsd.org>2019-01-26 11:57:22 +0000
committerMarcus Glocker <mglocker@cvs.openbsd.org>2019-01-26 11:57:22 +0000
commitd95b24f86fcbe651e46d0406c9fae696713dc63c (patch)
treeb205fb8f21cb9c8f2b22038e34472078a7f17c12
parent7f1ae736415733d5f862e1468f6a0499fd843f49 (diff)
Wait a bit for the set mode command to complete for Synaptics devices to
make sure that the device doesn't get enabled before, which would make it fail. Fixes regular occurring 'not in sync yet, discard input' issue seen on ThinkPad X1 Gen6. ok deraadt@
-rw-r--r--sys/dev/pckbc/pms.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/pckbc/pms.c b/sys/dev/pckbc/pms.c
index 95f1e4fd3a6..8704e12f7f7 100644
--- a/sys/dev/pckbc/pms.c
+++ b/sys/dev/pckbc/pms.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pms.c,v 1.87 2018/05/13 14:48:19 bru Exp $ */
+/* $OpenBSD: pms.c,v 1.88 2019/01/26 11:57:21 mglocker Exp $ */
/* $NetBSD: psm.c,v 1.11 2000/06/05 22:20:57 sommerfeld Exp $ */
/*-
@@ -962,6 +962,12 @@ synaptics_set_mode(struct pms_softc *sc, int mode)
pms_set_rate(sc, SYNAPTICS_CMD_SET_MODE))
return (-1);
+ /*
+ * Make sure that the set mode command has finished.
+ * Otherwise enabling the device before that will make it fail.
+ */
+ delay(10000);
+
syn->mode = mode;
return (0);