@@ -21,6 +21,7 @@
#include <linux/libps2.h>
#include <linux/mutex.h>
#include <linux/types.h>
+#include <linux/suspend.h>
#include "psmouse.h"
#include "synaptics.h"
@@ -1457,11 +1458,13 @@ static void psmouse_cleanup(struct serio *serio)
*/
ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_RESET_DIS);
- /*
- * Some boxes, such as HP nx7400, get terribly confused if mouse
- * is not fully enabled before suspending/shutting down.
- */
- ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_ENABLE);
+ if (!pm_suspend_default_s2idle() || device_may_wakeup(&serio->dev)) {
+ /*
+ * Some boxes, such as HP nx7400, get terribly confused if mouse
+ * is not fully enabled before suspending/shutting down.
+ */
+ ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_ENABLE);
+ }
if (parent) {
if (parent->pt_deactivate)
After commit 684bec1092b6 ("Input: i8042 - enable keyboard wakeups by default when s2idle is used"), kdb is enabled to wakeup laptops. Kbd fails to wakeup when touchpad/trackpoint is used on ThinkPad. The touchpad is not set to wakeup, and it shares buffer with kbd. Send disable command to PS/2 mouse when s2idle, make it clean for kdb to wakeup. Enable PS/2 mouse when wakeup enabled. Signed-off-by: Aaron Ma <aaron.ma@canonical.com> --- drivers/input/mouse/psmouse-base.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)