linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] input: egalax_ts: add system wakeup support
@ 2018-09-06  3:24 Anson Huang
  2018-09-06 16:46 ` Fabio Estevam
  0 siblings, 1 reply; 3+ messages in thread
From: Anson Huang @ 2018-09-06  3:24 UTC (permalink / raw)
  To: dmitry.torokhov, fabio.estevam, linux-input, linux-kernel; +Cc: Linux-imx

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>
---
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(+)

diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c
index 80e69bb..83ac8c1 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)
 	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);
 }
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH V2] input: egalax_ts: add system wakeup support
  2018-09-06  3:24 [PATCH V2] input: egalax_ts: add system wakeup support Anson Huang
@ 2018-09-06 16:46 ` Fabio Estevam
  2018-09-17 18:09   ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Fabio Estevam @ 2018-09-06 16:46 UTC (permalink / raw)
  To: Anson Huang
  Cc: Dmitry Torokhov, Fabio Estevam, linux-input, linux-kernel,
	NXP Linux Team

On Thu, Sep 6, 2018 at 12:24 AM, Anson Huang <Anson.Huang@nxp.com> wrote:
> 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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH V2] input: egalax_ts: add system wakeup support
  2018-09-06 16:46 ` Fabio Estevam
@ 2018-09-17 18:09   ` Dmitry Torokhov
  0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2018-09-17 18:09 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Anson Huang, Fabio Estevam, linux-input, linux-kernel, NXP Linux Team

On Thu, Sep 06, 2018 at 01:46:32PM -0300, Fabio Estevam wrote:
> On Thu, Sep 6, 2018 at 12:24 AM, Anson Huang <Anson.Huang@nxp.com> wrote:
> > 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>

Applied, thank you.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-17 18:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-06  3:24 [PATCH V2] input: egalax_ts: add system wakeup support Anson Huang
2018-09-06 16:46 ` Fabio Estevam
2018-09-17 18:09   ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).