From patchwork Thu Apr 10 02:11:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aubrey Li X-Patchwork-Id: 3958191 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DCAE8BFF02 for ; Thu, 10 Apr 2014 02:11:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 283572064D for ; Thu, 10 Apr 2014 02:11:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4022720635 for ; Thu, 10 Apr 2014 02:11:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934320AbaDJCLN (ORCPT ); Wed, 9 Apr 2014 22:11:13 -0400 Received: from mga09.intel.com ([134.134.136.24]:62768 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933779AbaDJCLM (ORCPT ); Wed, 9 Apr 2014 22:11:12 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 09 Apr 2014 19:06:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,830,1389772800"; d="scan'208";a="518140612" Received: from cli6-desk.ccr.corp.intel.com (HELO [10.239.37.134]) ([10.239.37.134]) by orsmga002.jf.intel.com with ESMTP; 09 Apr 2014 19:11:10 -0700 Message-ID: <5345FDBD.9090908@linux.intel.com> Date: Thu, 10 Apr 2014 10:11:09 +0800 From: "Li, Aubrey" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: dmitry.torokhov@gmail.com, sachin.kamat@linaro.org, linux-input@vger.kernel.org, LKML Subject: [patch]GPIO button is supposed to wake the system up if the wakeup attribute is set Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When the wakeup attribute is set, GPIO button is supposed to set irqflag - IRQF_NO_SUSPEND to request irq. So when the system enters the suspend sleep mode, the GPIO irq keeps enabled and is able to wake the system up. The affected/tested machines include Dell Venue 11 Pro and Asus T100TA. Signed-off-by: Aubrey Li Tested-by: Alan Cox --- drivers/input/keyboard/gpio_keys.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 2db1324..40f3963 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -503,6 +503,9 @@ static int gpio_keys_setup_key(struct platform_device *pdev, if (!button->can_disable) irqflags |= IRQF_SHARED; + if (button->wakeup) + irqflags |= IRQF_NO_SUSPEND; + error = request_any_context_irq(bdata->irq, isr, irqflags, desc, bdata); if (error < 0) { dev_err(dev, "Unable to claim irq %d; error %d\n",