diff options
author | Randall Spangler <rspangler@chromium.org> | 2013-04-01 10:56:33 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-04-02 14:12:57 -0700 |
commit | bdd16f82069f9e07e9a9e3008c318d9581ce0664 (patch) | |
tree | 16287a843f975c9505636dcc13fbaef50cb08f9a /include/lid_switch.h | |
parent | 50c53c0d542d6fc3184db09a35196b4c702536c5 (diff) | |
download | chrome-ec-bdd16f82069f9e07e9a9e3008c318d9581ce0664.tar.gz |
Split lid switch code out of switch.c to its own file
This will allow ARM code to use the same lid switch code (in a subsequent CL).
BUG=chrome-os-partner:18343
BRANCH=none
TEST=open lid; system boots. close lid; system suspends. open lid; resumes.
Change-Id: I83536a3ad24c4446dccf8a6b6e296756659070a8
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/47043
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'include/lid_switch.h')
-rw-r--r-- | include/lid_switch.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/lid_switch.h b/include/lid_switch.h new file mode 100644 index 0000000000..1bbb34cae2 --- /dev/null +++ b/include/lid_switch.h @@ -0,0 +1,27 @@ +/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* Lid switch API for Chrome EC */ + +#ifndef __CROS_EC_LID_SWITCH_H +#define __CROS_EC_LID_SWITCH_H + +#include "common.h" + +/** + * Return non-zero if lid is open. + * + * Uses the debounced lid state, not the raw signal from the GPIO. + */ +int lid_is_open(void); + +/** + * Interrupt handler for lid switch. + * + * @param signal Signal which triggered the interrupt. + */ +void lid_interrupt(enum gpio_signal signal); + +#endif /* __CROS_EC_LID_SWITCH_H */ |