All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeffy Chen <jeffy.chen@rock-chips.com>
To: linux-kernel@vger.kernel.org
Cc: briannorris@chromium.org, dmitry.torokhov@gmail.com,
	dbasehore@google.com, dianders@chromium.org,
	Jeffy Chen <jeffy.chen@rock-chips.com>
Subject: [PATCH v2] input: cros_ec_keyb: Report wakeup events
Date: Sun,  2 Apr 2017 08:07:39 +0800	[thread overview]
Message-ID: <1491091659-6546-2-git-send-email-jeffy.chen@rock-chips.com> (raw)
In-Reply-To: <1491091659-6546-1-git-send-email-jeffy.chen@rock-chips.com>

Report wakeup events when process events.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---

Changes in v2:
Remove unneeded dts changes.

 drivers/input/keyboard/cros_ec_keyb.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
index 6a250d6..a93d55f 100644
--- a/drivers/input/keyboard/cros_ec_keyb.c
+++ b/drivers/input/keyboard/cros_ec_keyb.c
@@ -286,6 +286,9 @@ static int cros_ec_keyb_work(struct notifier_block *nb,
 		return NOTIFY_DONE;
 	}
 
+	if (device_may_wakeup(ckdev->dev))
+		pm_wakeup_event(ckdev->dev, 0);
+
 	return NOTIFY_OK;
 }
 
@@ -632,6 +635,12 @@ static int cros_ec_keyb_probe(struct platform_device *pdev)
 		return err;
 	}
 
+	err = device_init_wakeup(dev, 1);
+	if (err) {
+		dev_err(dev, "cannot init wakeup: %d\n", err);
+		return err;
+	}
+
 	return 0;
 }
 
-- 
2.1.4

  reply	other threads:[~2017-04-02  0:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-02  0:07 [PATCH v2 0/1] Set cros_ec_keyb as a wakeup source Jeffy Chen
2017-04-02  0:07 ` Jeffy Chen [this message]
2017-04-03 18:43   ` [PATCH v2] input: cros_ec_keyb: Report wakeup events Dmitry Torokhov
2017-04-03 20:53     ` Brian Norris
2017-04-03 22:41       ` Dmitry Torokhov
2017-04-05  1:20         ` jeffy
2017-06-21  8:40           ` jeffy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1491091659-6546-2-git-send-email-jeffy.chen@rock-chips.com \
    --to=jeffy.chen@rock-chips.com \
    --cc=briannorris@chromium.org \
    --cc=dbasehore@google.com \
    --cc=dianders@chromium.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.