linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: gpio_keys: support wakeup system from freeze mode
@ 2013-12-23 18:21 Anson Huang
  2013-12-24  0:30 ` Dmitry Torokhov
  0 siblings, 1 reply; 4+ messages in thread
From: Anson Huang @ 2013-12-23 18:21 UTC (permalink / raw)
  To: dmitry.torokhov, sachin.kamat; +Cc: linux-input

For "freeze" mode of suspend, cpu will go into idle and
those wakeup sources' irq should NOT be disabled during
devices suspend, so we need to add IRQF_NO_SUSPEND flag
for those wakeup sources.

Steps to test this patch:

1. echo freeze > /sys/power/state;
2. press gpio key which has wakeup function, then system
   will resume.

Signed-off-by: Anson Huang <b20788@freescale.com>
---
 drivers/input/keyboard/gpio_keys.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 2db1324..aadb1db 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -473,6 +473,8 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
 
 		isr = gpio_keys_gpio_isr;
 		irqflags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING;
+		if (bdata->button->wakeup)
+			irqflags |= IRQF_NO_SUSPEND;
 
 	} else {
 		if (!button->irq) {
-- 
1.7.9.5



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

end of thread, other threads:[~2013-12-26 23:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-23 18:21 [PATCH] Input: gpio_keys: support wakeup system from freeze mode Anson Huang
2013-12-24  0:30 ` Dmitry Torokhov
2013-12-24  2:29   ` Anson.Huang
2013-12-26 23:35     ` 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).