diff options
author | Jiri Kosina <jkosina@suse.cz> | 2020-10-15 20:46:23 +0200 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2020-10-15 20:46:23 +0200 |
commit | 3504e85cd8b1d18005f1867aa2a72bd48bd472fd (patch) | |
tree | b85b487350665e9633872695455738fc41805cea | |
parent | 9b14b066796d0e8bd05f200f30cb4222f8c0f9f1 (diff) | |
parent | 203c38fbe833abb47212db77004c05793b7220a3 (diff) |
Merge branch 'for-5.10/i2c-hid' into for-linus
- i2c-hid support for wakeup from suspend-to-idle
-rw-r--r-- | drivers/hid/i2c-hid/i2c-hid-core.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c index ac115cb50b34..786e3e9af1c9 100644 --- a/drivers/hid/i2c-hid/i2c-hid-core.c +++ b/drivers/hid/i2c-hid/i2c-hid-core.c @@ -935,6 +935,14 @@ static void i2c_hid_acpi_fix_up_power(struct device *dev) acpi_device_fix_up_power(adev); } +static void i2c_hid_acpi_enable_wakeup(struct device *dev) +{ + if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) { + device_set_wakeup_capable(dev, true); + device_set_wakeup_enable(dev, false); + } +} + static const struct acpi_device_id i2c_hid_acpi_match[] = { {"ACPI0C50", 0 }, {"PNP0C50", 0 }, @@ -949,6 +957,8 @@ static inline int i2c_hid_acpi_pdata(struct i2c_client *client, } static inline void i2c_hid_acpi_fix_up_power(struct device *dev) {} + +static inline void i2c_hid_acpi_enable_wakeup(struct device *dev) {} #endif #ifdef CONFIG_OF @@ -1076,6 +1086,8 @@ static int i2c_hid_probe(struct i2c_client *client, i2c_hid_acpi_fix_up_power(&client->dev); + i2c_hid_acpi_enable_wakeup(&client->dev); + device_enable_async_suspend(&client->dev); /* Make sure there is something at this address */ |