#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/of.h>
+#include <linux/pm_wakeirq.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <asm/unaligned.h>
u8 pkg_size;
enum raydium_boot_mode boot_mode;
-
- bool wake_irq_enabled;
};
/*
return error;
}
+ /*
+ * The wake IRQ should be declared via device tree instead of assuming
+ * the IRQ can wake the system. This is here for legacy reasons and
+ * will be removed once the i2c-core supports querying ACPI for wake
+ * capabilities.
+ */
+ if (!client->dev.power.wakeirq)
+ dev_pm_set_wake_irq(&client->dev, client->irq);
+
error = devm_device_add_group(&client->dev,
&raydium_i2c_attribute_group);
if (error) {
if (device_may_wakeup(dev)) {
raydium_enter_sleep(client);
-
- ts->wake_irq_enabled = (enable_irq_wake(client->irq) == 0);
} else {
raydium_i2c_power_off(ts);
}
struct raydium_data *ts = i2c_get_clientdata(client);
if (device_may_wakeup(dev)) {
- if (ts->wake_irq_enabled)
- disable_irq_wake(client->irq);
raydium_i2c_sw_reset(client);
} else {
raydium_i2c_power_on(ts);