From patchwork Mon May 18 09:35:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai-Heng Feng X-Patchwork-Id: 11555083 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2BF84618 for ; Mon, 18 May 2020 09:35:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1AC4F20709 for ; Mon, 18 May 2020 09:35:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726127AbgERJf3 (ORCPT ); Mon, 18 May 2020 05:35:29 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:54498 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726040AbgERJf3 (ORCPT ); Mon, 18 May 2020 05:35:29 -0400 Received: from 61-220-137-37.hinet-ip.hinet.net ([61.220.137.37] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jacB5-0007lg-5o; Mon, 18 May 2020 09:35:19 +0000 From: Kai-Heng Feng To: jikos@kernel.org, benjamin.tissoires@redhat.com Cc: Kai-Heng Feng , Hans de Goede , Aaron Ma , HungNien Chen , Pavel Balan , Daniel Playfair Cal , You-Sheng Yang , linux-input@vger.kernel.org (open list:HID CORE LAYER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] HID: i2c-hid: Enable touchpad wakeup from Suspend-to-Idle Date: Mon, 18 May 2020 17:35:10 +0800 Message-Id: <20200518093511.29530-1-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.17.1 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Many laptops have the ability to be woken up from Suspend-to-Idle by touchpad. This is also the default behavior on other OSes. So let's enable the wakeup support if the system defaults to use Suspend-to-Idle. Signed-off-by: Kai-Heng Feng Reported-by: kbuild test robot --- drivers/hid/i2c-hid/i2c-hid-core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c index 294c84e136d7..cac82971a668 100644 --- a/drivers/hid/i2c-hid/i2c-hid-core.c +++ b/drivers/hid/i2c-hid/i2c-hid-core.c @@ -1072,6 +1072,11 @@ static int i2c_hid_probe(struct i2c_client *client, i2c_hid_acpi_fix_up_power(&client->dev); + if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) { + device_set_wakeup_capable(&client->dev, true); + device_wakeup_enable(&client->dev); + } + device_enable_async_suspend(&client->dev); /* Make sure there is something at this address */