mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kai-Heng Feng <kai.heng.feng@canonical.com>
To: jikos@kernel.org, benjamin.tissoires@redhat.com
Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Aaron Ma <aaron.ma@canonical.com>,
	HungNien Chen <hn.chen@weidahitech.com>,
	Pavel Balan <admin@kryma.net>,
	Daniel Playfair Cal <daniel.playfair.cal@gmail.com>,
	You-Sheng Yang <vicamo.yang@canonical.com>,
	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	[thread overview]
Message-ID: <20200518093511.29530-1-kai.heng.feng@canonical.com> (raw)

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 <kai.heng.feng@canonical.com>
---
 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 */
-- 
2.17.1


             reply	other threads:[~2020-05-18  9:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-18  9:35 Kai-Heng Feng [this message]
2020-05-18 11:28 ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200518093511.29530-1-kai.heng.feng@canonical.com \
    --to=kai.heng.feng@canonical.com \
    --cc=aaron.ma@canonical.com \
    --cc=admin@kryma.net \
    --cc=benjamin.tissoires@redhat.com \
    --cc=daniel.playfair.cal@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=hn.chen@weidahitech.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vicamo.yang@canonical.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®