Skip to content

Commit 3504e85

Browse files
author
Jiri Kosina
committed
Merge branch 'for-5.10/i2c-hid' into for-linus
- i2c-hid support for wakeup from suspend-to-idle
2 parents 9b14b06 + 203c38f commit 3504e85

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/hid/i2c-hid/i2c-hid-core.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,14 @@ static void i2c_hid_acpi_fix_up_power(struct device *dev)
935935
acpi_device_fix_up_power(adev);
936936
}
937937

938+
static void i2c_hid_acpi_enable_wakeup(struct device *dev)
939+
{
940+
if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) {
941+
device_set_wakeup_capable(dev, true);
942+
device_set_wakeup_enable(dev, false);
943+
}
944+
}
945+
938946
static const struct acpi_device_id i2c_hid_acpi_match[] = {
939947
{"ACPI0C50", 0 },
940948
{"PNP0C50", 0 },
@@ -949,6 +957,8 @@ static inline int i2c_hid_acpi_pdata(struct i2c_client *client,
949957
}
950958

951959
static inline void i2c_hid_acpi_fix_up_power(struct device *dev) {}
960+
961+
static inline void i2c_hid_acpi_enable_wakeup(struct device *dev) {}
952962
#endif
953963

954964
#ifdef CONFIG_OF
@@ -1076,6 +1086,8 @@ static int i2c_hid_probe(struct i2c_client *client,
10761086

10771087
i2c_hid_acpi_fix_up_power(&client->dev);
10781088

1089+
i2c_hid_acpi_enable_wakeup(&client->dev);
1090+
10791091
device_enable_async_suspend(&client->dev);
10801092

10811093
/* Make sure there is something at this address */

0 commit comments

Comments
 (0)