From patchwork Sat Jun 12 07:46:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Rui X-Patchwork-Id: 105723 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o5C7j62G002671 for ; Sat, 12 Jun 2010 07:46:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753004Ab0FLHqI (ORCPT ); Sat, 12 Jun 2010 03:46:08 -0400 Received: from mga02.intel.com ([134.134.136.20]:40501 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752940Ab0FLHqI (ORCPT ); Sat, 12 Jun 2010 03:46:08 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 12 Jun 2010 00:42:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.53,407,1272870000"; d="scan'208";a="526212127" Received: from rzhang1-desktop.sh.intel.com (HELO [10.239.36.107]) ([10.239.36.107]) by orsmga002.jf.intel.com with ESMTP; 12 Jun 2010 00:45:08 -0700 Subject: [PATCH 4/4 V2] ACPI: introduce module parameter acpi.aml_debug From: Zhang Rui To: "Brown, Len" Cc: "linux-acpi@vger.kernel.org" , "Zhang, Rui" , "Moore, Robert" Date: Sat, 12 Jun 2010 15:46:30 +0800 Message-ID: <1276328790.19052.17845.camel@rzhang1-desktop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sat, 12 Jun 2010 07:46:09 +0000 (UTC) Index: linux-2.6/drivers/acpi/debugfs.c =================================================================== --- linux-2.6.orig/drivers/acpi/debugfs.c +++ linux-2.6/drivers/acpi/debugfs.c @@ -9,6 +9,27 @@ #define _COMPONENT ACPI_SYSTEM_COMPONENT ACPI_MODULE_NAME("debugfs"); +static int param_set_aml_debug(const char *val, struct kernel_param *kp) +{ + if (!strncmp(val, "1\n", 2)) + acpi_gbl_enable_aml_debug_object = 1; + else if (!strncmp(val, "0\n", 2)) + acpi_gbl_enable_aml_debug_object = 0; + else + return -EINVAL; + + return 0; +} + +static int param_get_aml_debug(char *buffer, struct kernel_param *kp) +{ + if (acpi_gbl_enable_aml_debug_object) + return sprintf(buffer, "1"); + else + return sprintf(buffer, "0"); +} + +module_param_call(aml_debug, param_set_aml_debug, param_get_aml_debug, NULL, 0644); /* -------------------------------------------------------------------------- DebugFS Interface -------------------------------------------------------------------------- */ Index: linux-2.6/Documentation/acpi/method-customizing.txt =================================================================== --- linux-2.6.orig/Documentation/acpi/method-customizing.txt +++ linux-2.6/Documentation/acpi/method-customizing.txt @@ -19,6 +19,8 @@ Note: Only ACPI METHOD can be overridden "Device", "OperationRegion", are not recognized. Note: The same ACPI control method can be overridden for many times, and it's always the latest one that used by Linux/kernel. +Note: To get the ACPI debug object output (Store (AAAA, Debug)), + please run "echo 1 > /sys/module/acpi/parameters/aml_debug". 1. override an existing method a) get the ACPI table via ACPI sysfs I/F. e.g. to get the DSDT,