From patchwork Thu Mar 30 09:50:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeffy Chen X-Patchwork-Id: 9653437 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C97AC602C8 for ; Thu, 30 Mar 2017 09:51:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C5E9726E5D for ; Thu, 30 Mar 2017 09:51:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA60F28582; Thu, 30 Mar 2017 09:51:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4FF8126E5D for ; Thu, 30 Mar 2017 09:51:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932666AbdC3JvV (ORCPT ); Thu, 30 Mar 2017 05:51:21 -0400 Received: from regular1.263xmail.com ([211.150.99.140]:49938 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751030AbdC3JvU (ORCPT ); Thu, 30 Mar 2017 05:51:20 -0400 Received: from jeffy.chen?rock-chips.com (unknown [192.168.165.103]) by regular1.263xmail.com (Postfix) with ESMTP id 49B824E1C; Thu, 30 Mar 2017 17:51:08 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from smtp.263.net (sg-smtp01.263.net [54.255.195.220]) by smtp.263.net (Postfix) with ESMTP id 4588143D; Thu, 30 Mar 2017 17:50:58 +0800 (CST) Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.263.net (Postfix) with ESMTP id 6D7ABDF313; Thu, 30 Mar 2017 17:50:59 +0800 (CST) X-RL-SENDER: jeffy.chen@rock-chips.com X-FST-TO: linux-kernel@vger.kernel.org X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: jeffy.chen@rock-chips.com X-UNIQUE-TAG: <6ce9d7027527fa92540dec85f31957fa> X-ATTACHMENT-NUM: 0 X-SENDER: cjf@rock-chips.com X-DNS-TYPE: 0 Received: from localhost (unknown [103.29.142.67]) by smtp.263.net (Postfix) whith ESMTP id 16080SN8D9Z; Thu, 30 Mar 2017 17:51:00 +0800 (CST) From: Jeffy Chen To: linux-kernel@vger.kernel.org Cc: briannorris@chromium.org, dmitry.torokhov@gmail.com, dbasehore@google.com, dianders@chromium.org, Jeffy Chen , Gwendal Grignou , Vic Yang , linux-input@vger.kernel.org, Enric Balletbo Serra , Lee Jones Subject: [PATCH 1/2] input: cros_ec_keyb: Report wakeup events Date: Thu, 30 Mar 2017 17:50:49 +0800 Message-Id: <1490867450-31765-2-git-send-email-jeffy.chen@rock-chips.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1490867450-31765-1-git-send-email-jeffy.chen@rock-chips.com> References: <1490867450-31765-1-git-send-email-jeffy.chen@rock-chips.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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); + if (err) { + dev_err(dev, "cannot init wakeup: %d\n", err); + return err; + } + return 0; }