From patchwork Fri May 25 10:40:47 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: 161282 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 D0A9FB6EEB for ; Fri, 25 May 2012 20:41:01 +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 1SXrx6-0008RN-MJ for incoming@patchwork.ozlabs.org; Fri, 25 May 2012 10:41:00 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SXrx1-0008QD-Ja for fwts-devel@lists.ubuntu.com; Fri, 25 May 2012 10:40:55 +0000 Received: from cpc19-craw6-2-0-cust5.croy.cable.virginmedia.com ([77.102.228.6] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1SXrx1-0005cw-Gb for fwts-devel@lists.ubuntu.com; Fri, 25 May 2012 10:40:55 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH 2/8] lib: fwts_button.c: add more comments Date: Fri, 25 May 2012 11:40:47 +0100 Message-Id: <1337942453-30224-3-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1337942453-30224-1-git-send-email-colin.king@canonical.com> References: <1337942453-30224-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/lib/src/fwts_button.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/lib/src/fwts_button.c b/src/lib/src/fwts_button.c index e0574b8..2b8302f 100644 --- a/src/lib/src/fwts_button.c +++ b/src/lib/src/fwts_button.c @@ -29,6 +29,11 @@ #define FWTS_PROC_ACPI_BUTTON "/proc/acpi/button" +/* + * fwts_button_match_state_proc() + * find matching button state and keep count of matching + * any non-matching states found, via proc iterface + */ static int fwts_button_match_state_proc(fwts_framework *fw, int button, int *matched, int *not_matched) { @@ -88,6 +93,20 @@ static int fwts_button_match_state_proc(fwts_framework *fw, return FWTS_OK; } +/* + * fwts_button_match_state_proc() + * find matching button state and keep count of matching + * any non-matching states found + * + * The button state can be: + * FWTS_BUTTON_LID_ANY - match any LID button state + * FWTS_BUTTON_LID_OPENED - match any LID buttons that are open + * FWTS_BUTTON_LID_CLOSED - match any LID buttons that are closed + * FWTS_BUTTON_POWER_EXISTS - match any power putton states + * + * matched is a count of any button states that match, and not_matched + * is a count of any button states that don't match. + */ int fwts_button_match_state(fwts_framework *fw, int button, int *matched, int *not_matched) { *matched = 0;