Skip to content

Commit

Permalink
Merge branch 'for-5.10/i2c-hid' into for-linus
Browse files Browse the repository at this point in the history
- i2c-hid support for wakeup from suspend-to-idle
  • Loading branch information
Jiri Kosina committed Oct 15, 2020
2 parents 9b14b06 + 203c38f commit 3504e85
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/hid/i2c-hid/i2c-hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand All @@ -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
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 3504e85

Please sign in to comment.