From patchwork Fri May 25 10:40:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2/8] lib: fwts_button.c: add more comments Date: Fri, 25 May 2012 00:40:47 -0000 From: Colin King X-Patchwork-Id: 161282 Message-Id: <1337942453-30224-3-git-send-email-colin.king@canonical.com> To: fwts-devel@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;