From bdd16f82069f9e07e9a9e3008c318d9581ce0664 Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Mon, 1 Apr 2013 10:56:33 -0700 Subject: 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 Reviewed-on: https://gerrit.chromium.org/gerrit/47043 Reviewed-by: Bill Richardson --- include/lid_switch.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 include/lid_switch.h (limited to 'include/lid_switch.h') 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 */ -- cgit v1.2.1