From c2872486ecdbb9e151eef60bdfca0382ba57acda Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Wed, 3 Dec 2014 13:18:47 +0100 Subject: [PATCH] Reset PS/2 devices before probing as synaptics touchpad. Patch from dukscry, fixes #8616. --- src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.cpp b/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.cpp index 06232fef04..cba23a3f07 100644 --- a/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.cpp +++ b/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.cpp @@ -57,6 +57,7 @@ send_touchpad_arg_timeout(ps2_dev *dev, uint8 arg, bigtime_t timeout) { int8 i; uint8 val[8]; + for (i = 0; i < 4; i++) { val[2 * i] = (arg >> (6 - 2 * i)) & 3; val[2 * i + 1] = 0xE8; @@ -280,6 +281,15 @@ probe_synaptics(ps2_dev *dev) status_t status; TRACE("SYNAPTICS: probe\n"); + // We reset the device here because it may have been left in a confused + // state by a previous probing attempt. Some synaptics touchpads are known + // to lockup when we attempt to detect them as IBM trackoints. + ps2_reset_mouse(dev); + + // And after resetting we must wait a little for the device to become ready + // again... + snooze(400000); + status = send_touchpad_arg(dev, 0x00); if (status != B_OK) return status;