@@ -446,17 +446,15 @@ static int i8042_start(struct serio *serio)
{
struct i8042_port *port = serio->port_data;
- device_set_wakeup_capable(&serio->dev, true);
-
/*
- * On platforms using suspend-to-idle, allow the keyboard to
- * wake up the system from sleep by enabling keyboard wakeups
- * by default. This is consistent with keyboard wakeup
- * behavior on many platforms using suspend-to-RAM (ACPI S3)
- * by default.
+ * On platforms using suspend-to-idle
+ * In fact, people nowadays prefer to wake up systems using
+ * keyboards or mice. But after the previous code flow
+ * entered S3, the mouse could not wakeup the system
+ * and caused the keyboard to fail to wake up.
*/
- if (pm_suspend_default_s2idle() &&
- serio == i8042_ports[I8042_KBD_PORT_NO].serio) {
+ if (pm_suspend_default_s2idle()) {
+ device_set_wakeup_capable(&serio->dev, true);
device_set_wakeup_enable(&serio->dev, true);
}