From: Jeffy Chen <jeffy.chen@rock-chips.com>
To: linux-kernel@vger.kernel.org
Cc: briannorris@chromium.org, dmitry.torokhov@gmail.com,
dianders@chromium.org, Jeffy Chen <jeffy.chen@rock-chips.com>,
Gwendal Grignou <gwendal@chromium.org>,
Guenter Roeck <linux@roeck-us.net>, Arnd Bergmann <arnd@arndb.de>,
Vic Yang <victoryang@google.com>,
linux-input@vger.kernel.org,
Enric Balletbo Serra <enric.balletbo@collabora.com>,
Lee Jones <lee.jones@linaro.org>
Subject: [RFC PATCH v3 5/6] input: cros_ec_keyb: report wakeup events
Date: Wed, 21 Jun 2017 18:01:52 +0800 [thread overview]
Message-ID: <1498039313-24220-6-git-send-email-jeffy.chen@rock-chips.com> (raw)
In-Reply-To: <1498039313-24220-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 v3:
Use wakeup-source property to enable wakeup.
Suggested by Dmitry Torokhov <dmitry.torokhov@gmail.com>.
drivers/input/keyboard/cros_ec_keyb.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
index 79eb295..5dc387b 100644
--- a/drivers/input/keyboard/cros_ec_keyb.c
+++ b/drivers/input/keyboard/cros_ec_keyb.c
@@ -293,6 +293,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;
}
@@ -639,6 +642,9 @@ static int cros_ec_keyb_probe(struct platform_device *pdev)
return err;
}
+ if (device_property_read_bool(dev, "wakeup-source"))
+ device_init_wakeup(dev, true);
+
return 0;
}
@@ -649,6 +655,8 @@ static int cros_ec_keyb_remove(struct platform_device *pdev)
blocking_notifier_chain_unregister(&ckdev->ec->event_notifier,
&ckdev->notifier);
+ device_init_wakeup(&pdev->dev, false);
+
return 0;
}
--
2.1.4
next prev parent reply other threads:[~2017-06-21 10:04 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-21 10:01 [RFC PATCH v3 0/6] Report wakeup events in cros_ec_keyb and make cros-ec-spi wakeup optional Jeffy Chen
2017-06-21 10:01 ` [RFC PATCH v3 1/6] spi: core: add support for wakeup-source dts property Jeffy Chen
2017-06-21 10:52 ` Mark Brown
2017-06-21 10:01 ` [RFC PATCH v3 2/6] dt-bindings: spi/core: add wakeup-source optional property Jeffy Chen
2017-06-26 16:00 ` Rob Herring
2017-06-26 16:40 ` Dmitry Torokhov
2017-06-27 2:04 ` jeffy
2017-06-30 14:44 ` Rob Herring
2017-06-21 10:01 ` [RFC PATCH v3 3/6] ARM/arm64: dts: enable wakeup for cros-ec-spi devices Jeffy Chen
2017-06-21 10:45 ` Krzysztof Kozlowski
[not found] ` <594A91C9.1090906@rock-chips.com>
2017-06-21 15:36 ` Krzysztof Kozlowski
2017-06-22 2:33 ` jeffy
2017-06-21 10:01 ` [RFC PATCH v3 4/6] mfd: cros ec: spi: remove unconditionally wakeup enable Jeffy Chen
2017-06-21 10:01 ` Jeffy Chen [this message]
2017-06-21 10:01 ` [RFC PATCH v3 6/6] ARM: dts: cros-ec-keyboard: enable as wakeup source Jeffy Chen
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=1498039313-24220-6-git-send-email-jeffy.chen@rock-chips.com \
--to=jeffy.chen@rock-chips.com \
--cc=arnd@arndb.de \
--cc=briannorris@chromium.org \
--cc=dianders@chromium.org \
--cc=dmitry.torokhov@gmail.com \
--cc=enric.balletbo@collabora.com \
--cc=gwendal@chromium.org \
--cc=lee.jones@linaro.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=victoryang@google.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®