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: 1029752 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 p72GlhMP027329 for ; Tue, 2 Aug 2011 16:47:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754673Ab1HBQrm (ORCPT ); Tue, 2 Aug 2011 12:47:42 -0400 Received: from queueout02-winn.ispmail.ntl.com ([81.103.221.56]:64591 "EHLO queueout02-winn.ispmail.ntl.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754670Ab1HBQrl (ORCPT ); Tue, 2 Aug 2011 12:47:41 -0400 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 Cc: linux-input@vger.kernel.org Cc: linux-pm@lists.linux-foundation.org Cc: rjw@sisk.pl Cc: dilinger@queued.net Subject: [PATCH v4 2/2] i8042: Enable OLPC's EC-based i8042 wakeup control 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 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]); Tue, 02 Aug 2011 16:47:43 +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;