From patchwork Thu Jul 28 14:31:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Drake X-Patchwork-Id: 1015842 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6SEVnqc007723 for ; Thu, 28 Jul 2011 14:31:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753442Ab1G1Obt (ORCPT ); Thu, 28 Jul 2011 10:31:49 -0400 Received: from mtaout02-winn.ispmail.ntl.com ([81.103.221.48]:44258 "EHLO mtaout02-winn.ispmail.ntl.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752681Ab1G1Obs (ORCPT ); Thu, 28 Jul 2011 10:31:48 -0400 Received: from aamtaout04-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20110728143142.VEGW3933.mtaout02-winn.ispmail.ntl.com@aamtaout04-winn.ispmail.ntl.com>; Thu, 28 Jul 2011 15:31:42 +0100 Received: from zog.reactivated.net ([86.14.215.141]) by aamtaout04-winn.ispmail.ntl.com (InterMail vG.3.00.04.00 201-2196-133-20080908) with ESMTP id <20110728143142.YDIC25656.aamtaout04-winn.ispmail.ntl.com@zog.reactivated.net>; Thu, 28 Jul 2011 15:31:42 +0100 Received: by zog.reactivated.net (Postfix, from userid 1000) id 002459D401C; Thu, 28 Jul 2011 15:31:39 +0100 (BST) From: Daniel Drake To: dtor@mail.ru To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org Cc: linux-pm@lists.linux-foundation.org Cc: rjw@sisk.pl Cc: dilinger@queued.net Subject: [PATCH v3 2/2] i8042: Enable OLPC's EC-based i8042 wakeup control Message-Id: <20110728143140.002459D401C@zog.reactivated.net> Date: Thu, 28 Jul 2011 15:31:39 +0100 (BST) X-Cloudmark-Analysis: v=1.1 cv=R50lirqlHffDPPkwUlkuVa99MrvKdVWo//yz83qex8g= c=1 sm=0 a=p1z7mq30HYcA:10 a=vJ1w_8FsMGIA:10 a=Op-mwl0xAAAA:8 a=Z1no5zgwp2naUOVtonsA:9 a=1P1xVnlN2viLiNSIThwA:7 a=d4CUUju0HPYA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 28 Jul 2011 14:31:50 +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(-) This depends on patches merged into linus master 2 days ago. 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;