Skip to content
Snippets Groups Projects
Commit 49f62249 authored by Anson Huang's avatar Anson Huang Committed by Dmitry Torokhov
Browse files

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.

Signed-off-by: default avatarAnson Huang <Anson.Huang@nxp.com>
Reviewed-by: default avatarFabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent b8a946d8
No related branches found
No related tags found
No related merge requests found
...@@ -241,6 +241,9 @@ static int __maybe_unused egalax_ts_suspend(struct device *dev) ...@@ -241,6 +241,9 @@ static int __maybe_unused egalax_ts_suspend(struct device *dev)
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
int ret; int ret;
if (device_may_wakeup(dev))
return enable_irq_wake(client->irq);
ret = i2c_master_send(client, suspend_cmd, MAX_I2C_DATA_LEN); ret = i2c_master_send(client, suspend_cmd, MAX_I2C_DATA_LEN);
return ret > 0 ? 0 : ret; return ret > 0 ? 0 : ret;
} }
...@@ -249,6 +252,9 @@ static int __maybe_unused egalax_ts_resume(struct device *dev) ...@@ -249,6 +252,9 @@ static int __maybe_unused egalax_ts_resume(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(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); return egalax_wake_up_device(client);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment