summaryrefslogtreecommitdiff
path: root/drivers/i2c/i2c-core.h
diff options
context:
space:
mode:
authorRaul E Rangel <rrangel@chromium.org>2022-09-29 19:19:11 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-10-04 16:41:12 +0300
commitb38f2d5d9615cf991fb68626e70b042cb8b6dc3e (patch)
tree6bdfc74ccd20166fee0eb92898152c5338ca943f /drivers/i2c/i2c-core.h
parent5ff811604f93bdd2650beed80b48c2ca16c6fba6 (diff)
downloadlinux-b38f2d5d9615cf991fb68626e70b042cb8b6dc3e.tar.xz
i2c: acpi: Use ACPI wake capability bit to set wake_irq
Device tree already has a mechanism to pass the wake_irq. It does this by looking for the wakeup-source property and setting the I2C_CLIENT_WAKE flag. This CL adds the ACPI equivalent. It uses the ACPI interrupt wake flag to determine if the interrupt can be used to wake the system. Previously the i2c drivers had to make assumptions and blindly enable the wake IRQ. This can cause spurious wake events. e.g., If there is a device with an Active Low interrupt and the device gets powered off while suspending, the interrupt line will go low since it's no longer powered and wakes the system. For this reason we should respect the board designers wishes and honor the wake bit defined on the interrupt. Signed-off-by: Raul E Rangel <rrangel@chromium.org> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Wolfram Sang <wsa@kernel.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/i2c/i2c-core.h')
-rw-r--r--drivers/i2c/i2c-core.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/i2c/i2c-core.h b/drivers/i2c/i2c-core.h
index 87e2c914f1c5..1247e6e6e975 100644
--- a/drivers/i2c/i2c-core.h
+++ b/drivers/i2c/i2c-core.h
@@ -61,11 +61,11 @@ static inline int __i2c_check_suspended(struct i2c_adapter *adap)
#ifdef CONFIG_ACPI
void i2c_acpi_register_devices(struct i2c_adapter *adap);
-int i2c_acpi_get_irq(struct i2c_client *client);
+int i2c_acpi_get_irq(struct i2c_client *client, bool *wake_capable);
#else /* CONFIG_ACPI */
static inline void i2c_acpi_register_devices(struct i2c_adapter *adap) { }
-static inline int i2c_acpi_get_irq(struct i2c_client *client)
+static inline int i2c_acpi_get_irq(struct i2c_client *client, bool *wake_capable)
{
return 0;
}