From patchwork Tue Aug 2 15:49:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Drake X-Patchwork-Id: 1029642 Received: from smtp1.linux-foundation.org (smtp1.linux-foundation.org [140.211.169.13]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p72FtOHk032558 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Tue, 2 Aug 2011 15:55:44 GMT Received: from daredevil.linux-foundation.org (localhost [127.0.0.1]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id p72FqxcT031293; Tue, 2 Aug 2011 08:53:29 -0700 Received: from mtaout03-winn.ispmail.ntl.com (mtaout03-winn.ispmail.ntl.com [81.103.221.49]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id p72FneLB031084 for ; Tue, 2 Aug 2011 08:49:42 -0700 Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20110802154940.PQCM5301.mtaout03-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com>; Tue, 2 Aug 2011 16:49:40 +0100 Received: from zog.reactivated.net ([86.14.215.141]) by aamtaout01-winn.ispmail.ntl.com (InterMail vG.3.00.04.00 201-2196-133-20080908) with ESMTP id <20110802154940.ZOPI20122.aamtaout01-winn.ispmail.ntl.com@zog.reactivated.net>; Tue, 2 Aug 2011 16:49:40 +0100 Received: by zog.reactivated.net (Postfix, from userid 1000) id 7B80B9D401C; Tue, 2 Aug 2011 16:49:34 +0100 (BST) From: Daniel Drake To: dtor@mail.ru To: dmitry.torokhov@gmail.com Message-Id: <20110802154934.7B80B9D401C@zog.reactivated.net> Date: Tue, 2 Aug 2011 16:49:34 +0100 (BST) X-Cloudmark-Analysis: v=1.1 cv=JvdXmxIgLJv2/GthKqHpGJEEHukvLcvELVXUanXFreg= c=1 sm=0 a=c85TpDnYRNMA:10 a=vJ1w_8FsMGIA:10 a=Op-mwl0xAAAA:8 a=Z1no5zgwp2naUOVtonsA:9 a=XpX8F9Zci8wAj0zB7TwA:7 a=d4CUUju0HPYA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received-SPF: pass (localhost is always allowed.) X-Spam-Status: No, hits=-4.52 required=5 tests=AWL, BAYES_00, OSDL_HEADER_SUBJECT_BRACKETED X-Spam-Checker-Version: SpamAssassin 3.2.4-osdl_revision__1.47__ X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.21 Cc: linux-pm@lists.linux-foundation.org, dilinger@queued.net, linux-input@vger.kernel.org Subject: [linux-pm] [PATCH v4 2/2] i8042: Enable OLPC's EC-based i8042 wakeup control X-BeenThere: linux-pm@lists.linux-foundation.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux power management List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-pm-bounces@lists.linux-foundation.org Errors-To: linux-pm-bounces@lists.linux-foundation.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 02 Aug 2011 15:55:44 +0000 (UTC) The OLPC XO laptop can be resumed from suspend via keyboard or mouse activity. Hook up the i8042 driver to the OLPC EC controls to make this possible. Signed-off-by: Daniel Drake --- drivers/input/serio/i8042-x86ia64io.h | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index 76b2e58..36f6015 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h @@ -9,6 +9,7 @@ #ifdef CONFIG_X86 #include +#include #endif /* @@ -877,6 +878,13 @@ static inline void i8042_pnp_exit(void) { } static inline void i8042_platform_suspend(struct device *dev, bool may_wakeup) { + if (!machine_is_olpc()) + return; + + if (may_wakeup) + olpc_ec_wakeup_set(EC_SCI_SRC_GAME); + else + olpc_ec_wakeup_clear(EC_SCI_SRC_GAME); } static int __init i8042_platform_init(void) @@ -923,6 +931,9 @@ static int __init i8042_platform_init(void) if (dmi_check_system(i8042_dmi_dritek_table)) i8042_dritek = true; + + if (olpc_ec_wakeup_available()) + i8042_enable_wakeup = true; #endif /* CONFIG_X86 */ return retval;