From patchwork Thu Apr 19 08:49:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai-Heng Feng X-Patchwork-Id: 10349323 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1803160365 for ; Thu, 19 Apr 2018 08:50:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 06B6A289A9 for ; Thu, 19 Apr 2018 08:50:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB27D289AB; Thu, 19 Apr 2018 08:50:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55E82289A9 for ; Thu, 19 Apr 2018 08:50:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750884AbeDSIuC (ORCPT ); Thu, 19 Apr 2018 04:50:02 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:47705 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750735AbeDSIuB (ORCPT ); Thu, 19 Apr 2018 04:50:01 -0400 Received: from [175.41.48.77] (helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1f95GS-0007tL-3u; Thu, 19 Apr 2018 08:50:00 +0000 From: Kai-Heng Feng To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Kai-Heng Feng Subject: [PATCH v2] Input: i8042 - Fix KBD port cannot wake up system from suspend-to-idle Date: Thu, 19 Apr 2018 16:49:51 +0800 Message-Id: <20180419084951.25130-1-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.17.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kai Heng Feng Commit f13b2065de81 ("Input: i8042 - allow KBD and AUX ports to wake up from suspend-to-idle") make system in s2idle can be woken up by i8042 keyboard, but it's disabled by default. In commit 3e6e15a862a0 ("Input: enable remote wakeup for PNP i8042 keyboard ports") states that "Keyboard ports are always supposed to be wakeup-enabled", it should be enabled by default. Keyboard wakeup from s2idles is also the default behavior for other x86 OSes. In addition to PNP port, enable keyboard wakeup from serio port by default for x86 systems. Signed-off-by: Kai-Heng Feng --- v2: Keep the PNP wakeup part. Only enable for x86 systems. Update commit message. drivers/input/serio/i8042.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index 824f4c1c1f31..0b6878e8037b 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c @@ -1400,6 +1400,12 @@ static void __init i8042_register_ports(void) i8042_ports[i].irq); serio_register_port(serio); device_set_wakeup_capable(&serio->dev, true); + +#ifdef CONFIG_X86 + /* Keyboard ports are always supposed to be wakeup-enabled */ + if (i == I8042_KBD_PORT_NO) + device_wakeup_enable(&serio->dev); +#endif } } }