Skip to contentSkip to conversation

input: egalax_ts: add system wakeup support

PATCH Applied Anson Huang 3 participants 3 messages Sep 6, 2018 – Sep 17, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 input: egalax_ts: add system wakeup support

This patch adds wakeup function support for egalax touch screen, if "wakeup-source" is added to device tree's egalax touch screen node, the wakeup function will be enabled, and egalax touch screen will be able to wakeup system from suspend.

---
changes since V1:
remove unnecessary device wakeup check and fix the irq wake balance issue.

 drivers/input/touchscreen/egalax_ts.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/input/touchscreen/egalax_ts.c +6 -0
index 80e69bb..83ac8c1 100644
@@ -241,6 +241,9 @@ static int __maybe_unused egalax_ts_suspend(struct device *dev)
 	struct i2c_client *client = to_i2c_client(dev);
 	int ret;
 
+	if (device_may_wakeup(dev))
+		return enable_irq_wake(client->irq);
+
 	ret = i2c_master_send(client, suspend_cmd, MAX_I2C_DATA_LEN);
 	return ret > 0 ? 0 : ret;
 }
@@ -249,6 +252,9 @@ static int __maybe_unused egalax_ts_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 
+	if (device_may_wakeup(dev))
+		return disable_irq_wake(client->irq);
+
 	return egalax_wake_up_device(client);
 }
 
Signature · 1 line
2.7.4
maintainer Applied
#2 lore raw
Quoted 9 lines · Fabio Estevam
Quoted 6 lines · Anson Huang

This patch adds wakeup function support for egalax touch screen, if "wakeup-source" is added to device tree's egalax touch screen node, the wakeup function will be enabled, and egalax touch screen will be able to wakeup system from suspend.

Applied, thank you.

Signature · 1 line
Dmitry