diff mbox series

HID: i2c-hid: Enable touchpad wakeup from Suspend-to-Idle

Message ID 20200518093511.29530-1-kai.heng.feng@canonical.com
State New
Headers show
Series HID: i2c-hid: Enable touchpad wakeup from Suspend-to-Idle | expand

Commit Message

Kai-Heng Feng May 18, 2020, 9:35 a.m. UTC
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 mbox series

Patch

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 */