From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752072AbdDBAKc (ORCPT ); Sat, 1 Apr 2017 20:10:32 -0400 Received: from regular1.263xmail.com ([211.150.99.136]:55459 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751974AbdDBAKa (ORCPT ); Sat, 1 Apr 2017 20:10:30 -0400 X-263anti-spam: KSV:0;BIG:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ADDR-CHECKED4: 1 X-ABS-CHECKED: 1 X-SKE-CHECKED: 1 X-ANTISPAM-LEVEL: 2 X-RL-SENDER: jeffy.chen@rock-chips.com X-FST-TO: dmitry.torokhov@gmail.com X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: jeffy.chen@rock-chips.com X-UNIQUE-TAG: <25a2a7d2ad7a37b70fcd50c1c1125fca> X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Message-ID: <58E04167.5050004@rock-chips.com> Date: Sun, 02 Apr 2017 08:10:15 +0800 From: jeffy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20130126 Thunderbird/19.0 MIME-Version: 1.0 To: Dmitry Torokhov CC: linux-kernel@vger.kernel.org, briannorris@chromium.org, dbasehore@google.com, dianders@chromium.org, Gwendal Grignou , Vic Yang , linux-input@vger.kernel.org, Enric Balletbo Serra , Lee Jones Subject: Re: [PATCH 1/2] input: cros_ec_keyb: Report wakeup events References: <1490867450-31765-1-git-send-email-jeffy.chen@rock-chips.com> <1490867450-31765-2-git-send-email-jeffy.chen@rock-chips.com> <20170401171237.GH17130@dtor-ws> <20170401171414.GI17130@dtor-ws> In-Reply-To: <20170401171414.GI17130@dtor-ws> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dmitry, On 04/02/2017 01:14 AM, Dmitry Torokhov wrote: > On Sat, Apr 01, 2017 at 10:12:37AM -0700, Dmitry Torokhov wrote: >> Hi Jeffy, >> >> On Thu, Mar 30, 2017 at 05:50:49PM +0800, Jeffy Chen wrote: >>> Report wakeup events when process events. >>> >>> Signed-off-by: Jeffy Chen >>> --- >>> >>> 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); >> >> In the other patch you are adding "wakeup-source" to the DT binding, but >> here you mark all EC deices as wakeup sources. You need to use >> device_property_read_bool(dev, "wakeup-source") and use the result in >> call to device_init_wakeup(). > > And please also update device tree binding doc for the driver. > oops, sorry, i thought that dts property is needed to enable a wakeup source...but obviously it's not, only gpio-keys requires that. so the dts patch is not needed, will remove in next version, thanx. >> >>> + if (err) { >>> + dev_err(dev, "cannot init wakeup: %d\n", err); >>> + return err; >>> + } >>> + >>> return 0; >>> } >>> >> >> Thanks. >> >> -- >> Dmitry >