diff options
| author | Anson Huang <Anson.Huang@nxp.com> | 2018-09-17 14:08:52 -0400 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2018-09-18 18:28:07 -0400 |
| commit | 49f62249a9577b0f8c20c7c843d23289d143daf1 (patch) | |
| tree | a9e8440aab6221af0cd0cc9bd3c0276db6b9a3c2 | |
| parent | b8a946d8dc245ec3adae65c8eab6f3e73a950af3 (diff) | |
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: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
| -rw-r--r-- | drivers/input/touchscreen/egalax_ts.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c index 80e69bb8283e..83ac8c128192 100644 --- a/drivers/input/touchscreen/egalax_ts.c +++ b/drivers/input/touchscreen/egalax_ts.c | |||
| @@ -241,6 +241,9 @@ static int __maybe_unused egalax_ts_suspend(struct device *dev) | |||
| 241 | struct i2c_client *client = to_i2c_client(dev); | 241 | struct i2c_client *client = to_i2c_client(dev); |
| 242 | int ret; | 242 | int ret; |
| 243 | 243 | ||
| 244 | if (device_may_wakeup(dev)) | ||
| 245 | return enable_irq_wake(client->irq); | ||
| 246 | |||
| 244 | ret = i2c_master_send(client, suspend_cmd, MAX_I2C_DATA_LEN); | 247 | ret = i2c_master_send(client, suspend_cmd, MAX_I2C_DATA_LEN); |
| 245 | return ret > 0 ? 0 : ret; | 248 | return ret > 0 ? 0 : ret; |
| 246 | } | 249 | } |
| @@ -249,6 +252,9 @@ static int __maybe_unused egalax_ts_resume(struct device *dev) | |||
| 249 | { | 252 | { |
| 250 | struct i2c_client *client = to_i2c_client(dev); | 253 | struct i2c_client *client = to_i2c_client(dev); |
| 251 | 254 | ||
| 255 | if (device_may_wakeup(dev)) | ||
| 256 | return disable_irq_wake(client->irq); | ||
| 257 | |||
| 252 | return egalax_wake_up_device(client); | 258 | return egalax_wake_up_device(client); |
| 253 | } | 259 | } |
| 254 | 260 | ||
