From patchwork Wed Sep 19 17:53:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 185118 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 438B92C008A for ; Thu, 20 Sep 2012 03:54:02 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TEORE-00036K-Kd; Wed, 19 Sep 2012 17:51:52 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TEORC-00035s-UV for fwts-devel@lists.ubuntu.com; Wed, 19 Sep 2012 17:51:51 +0000 Received: from cpc3-craw6-2-0-cust180.croy.cable.virginmedia.com ([77.100.248.181] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1TEOTH-0007Dr-9M for fwts-devel@lists.ubuntu.com; Wed, 19 Sep 2012 17:53:59 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH 3/8] acpi: method: add BCT test Date: Wed, 19 Sep 2012 18:53:52 +0100 Message-Id: <1348077237-3143-4-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1348077237-3143-1-git-send-email-colin.king@canonical.com> References: <1348077237-3143-1-git-send-email-colin.king@canonical.com> X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: fwts-devel-bounces@lists.ubuntu.com Errors-To: fwts-devel-bounces@lists.ubuntu.com From: Colin Ian King Signed-off-by: Colin Ian King Acked-by: Keng-Yu Lin Acked-by: Ivan Hu --- src/acpi/method/method.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c index 86b20f0..8351abf 100644 --- a/src/acpi/method/method.c +++ b/src/acpi/method/method.c @@ -47,7 +47,7 @@ * _BBN 6.5.5 Y * _BCL B.6.2 Y * _BCM B.6.3 Y - * _BCT 10.2.29 N + * _BCT 10.2.29 Y * _BDN 6.5.3 Y * _BFS 7.3.1 deprecated * _BIF 10.2.2.1 Y @@ -1495,6 +1495,21 @@ static int method_test_SBS(fwts_framework *fw) /* * Section 10.2 Battery Control Methods */ +static int method_test_BCT(fwts_framework *fw) +{ + ACPI_OBJECT arg[1]; + arg[0].Type = ACPI_TYPE_INTEGER; + arg[0].Integer.Value = 50; /* 50% */ + + /* + * For now, just check that we get some integer back, values + * can be 0x00000000, 0x00000001-0xfffffffe and 0xffffffff, + * so anything is valid as long as it is an integer + */ + return method_evaluate_method(fw, METHOD_MOBILE, + "_BCT", arg, 1, method_test_integer_return, NULL); +} + static void method_test_BIF_return( fwts_framework *fw, char *name, @@ -3136,14 +3151,13 @@ static fwts_framework_minor_test method_tests[] = { /* Section 10.2 Battery Controls */ - /* { method_test_BCT, "Check _BCT (Battery Charge Time)." }, */ + { method_test_BCT, "Check _BCT (Battery Charge Time)." }, { method_test_BIF, "Check _BIF (Battery Information)." }, { method_test_BIX, "Check _BIX (Battery Information Extended)." }, { method_test_BMA, "Check _BMA (Battery Measurement Averaging)." }, { method_test_BMC, "Check _BMC (Battery Maintenance Control)." }, { method_test_BMD, "Check _BMD (Battery Maintenance Data)." }, { method_test_BMS, "Check _BMS (Battery Measurement Sampling Time)." }, - /* { method_test_BMT, "Check _BMT (Battery Time)." }, */ { method_test_BST, "Check _BST (Battery Status)." }, { method_test_BTP, "Check _BTP (Battery Trip Point)." }, { method_test_BTM, "Check _BTM (Battery Time)." },