diff options
author | Randall Spangler <rspangler@chromium.org> | 2012-10-29 14:13:36 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-10-30 14:50:03 -0700 |
commit | a21ea56e76ff71849d45f59608c0beb7bede4c02 (patch) | |
tree | d8e3bd5d57920878f9603cf4c3fee7b39b371188 /include/switch.h | |
parent | 80467aff915c638b1c3f96a51becffd493791962 (diff) | |
download | chrome-ec-a21ea56e76ff71849d45f59608c0beb7bede4c02.tar.gz |
Rename power_button module to switch
Since it handles not just power button, but also lid switch, AC
detect, and other switches.
No functional changes; just renaming.
BUG=chrome-os-partner:15579
BRANCH=none
TEST=boot system, power on/off with power button
Change-Id: I51628a52293f7207715f5f6bf368a08fe6c3dbce
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36821
Diffstat (limited to 'include/switch.h')
-rw-r--r-- | include/switch.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/include/switch.h b/include/switch.h new file mode 100644 index 0000000000..9c4dfef498 --- /dev/null +++ b/include/switch.h @@ -0,0 +1,43 @@ +/* Copyright (c) 2012 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. + */ + +/* Switch module for Chrome EC */ + +#ifndef __CROS_EC_SWITCH_H +#define __CROS_EC_SWITCH_H + +#include "common.h" +#include "gpio.h" + +/** + * Interrupt handler for switch inputs. + * + * @param signal Signal which triggered the interrupt. + */ +void switch_interrupt(enum gpio_signal signal); + +/** + * Switch task. + */ +void switch_task(void); + +/** + * Return non-zero if AC power is present. + */ +int switch_get_ac_present(void); + +/** + * Return non-zero if lid is open. + * + * Uses the debounced lid state, not the raw signal from the GPIO. + */ +int switch_get_lid_open(void); + +/** + * Return non-zero if write protect signal is asserted. + */ +int switch_get_write_protect(void); + +#endif /* __CROS_EC_SWITCH_H */ |