From patchwork Thu Mar 29 17:02:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seth Forshee X-Patchwork-Id: 149434 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 8C3F8B6EEF for ; Fri, 30 Mar 2012 04:02:31 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SDIjs-0002Bz-UD; Thu, 29 Mar 2012 17:02:20 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SDIjr-0002BA-0v for kernel-team@lists.ubuntu.com; Thu, 29 Mar 2012 17:02:19 +0000 Received: from 64-126-113-183.dyn.everestkc.net ([64.126.113.183] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1SDIjq-0002RZ-OO for kernel-team@lists.ubuntu.com; Thu, 29 Mar 2012 17:02:19 +0000 From: Seth Forshee To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/5][Precise] UBUNTU: SAUCE: (drop after 3.3) ACPI: EC: Add ec_get_handle() Date: Thu, 29 Mar 2012 12:02:05 -0500 Message-Id: <1333040528-26202-3-git-send-email-seth.forshee@canonical.com> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1333040528-26202-1-git-send-email-seth.forshee@canonical.com> References: <1333040528-26202-1-git-send-email-seth.forshee@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com toshiba_acpi needs to execute an AML method within the EC namespace to make hotkeys work on some platforms. Provide an interface to allow it to easily get a handle to the EC namespace for this purpose. Signed-off-by: Seth Forshee Signed-off-by: Matthew Garrett (cherry picked from commit 3e2abc5a35d25442821e1733687b7abbc83b5072) BugLink: http://bugs.launchpad.net/bugs/810015 --- drivers/acpi/ec.c | 10 ++++++++++ include/linux/acpi.h | 1 + 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index b19a18d..e37615f 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -445,6 +445,16 @@ int ec_transaction(u8 command, EXPORT_SYMBOL(ec_transaction); +/* Get the handle to the EC device */ +acpi_handle ec_get_handle(void) +{ + if (!first_ec) + return NULL; + return first_ec->handle; +} + +EXPORT_SYMBOL(ec_get_handle); + void acpi_ec_block_transactions(void) { struct acpi_ec *ec = first_ec; diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 6001b4da..ecccbb7 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -151,6 +151,7 @@ extern int ec_write(u8 addr, u8 val); extern int ec_transaction(u8 command, const u8 *wdata, unsigned wdata_len, u8 *rdata, unsigned rdata_len); +extern acpi_handle ec_get_handle(void); #if defined(CONFIG_ACPI_WMI) || defined(CONFIG_ACPI_WMI_MODULE)