diff options
author | Dmitry Torokhov <dtor@chromium.org> | 2018-08-15 17:16:35 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-08-22 00:10:42 -0700 |
commit | f70528e53dfbdc1f33508d157b05c608934a660f (patch) | |
tree | 214ba254482057090389c2e3170447fd51ef3f4b /include/base_state.h | |
parent | b8489de98f1cf3e32fbcbe4b6f6163dff4a55c78 (diff) | |
download | chrome-ec-f70528e53dfbdc1f33508d157b05c608934a660f.tar.gz |
common: add API to expose detachable "base" state
On some detachables, when base is attached, we know right away that the
device should transition from tablet to clamshell mode. However on other
detachables we need additional information (i.e. base position) before
we decide whether to transition in/out of tablet mode. For such
detachables let's allow them to signal a new "base attached" switch
event, so that the rest of the stack is not confused.
BUG=b:73133611
BRANCH=nocturne
TEST=Build and boot
Change-Id: I9be3450cba52bf9f0bad8333402f68b0c7903090
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1176801
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'include/base_state.h')
-rw-r--r-- | include/base_state.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/base_state.h b/include/base_state.h new file mode 100644 index 0000000000..6ee0948e5f --- /dev/null +++ b/include/base_state.h @@ -0,0 +1,15 @@ +/* Copyright 2018 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. + */ + +/** + * Return 1 if base attached, 0 otherwise. + */ +int base_get_state(void); + +/** + * Sets the current state of the base, with 0 meaning detached, + * and non-zero meaning attached. + */ +void base_set_state(int state); |