summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2016-10-21 16:35:12 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-11-08 17:11:28 -0800
commit9b67ffcd527c6244a9f1946072f40e8e9fd9b940 (patch)
tree34b363bfdbe8a74123724b7cf6cd44a417e91376 /include
parent8bb2d9fbf0d0a8d6810a9f08dd0437cfa3745db2 (diff)
downloadchrome-ec-9b67ffcd527c6244a9f1946072f40e8e9fd9b940.tar.gz
common: Add tablet_mode API
Simple API to set/get the tablet mode. It can be set via lid angle calculation or if a board has a dedicated HAL sensor/GPIO. Merged from glados branch, add MKBP switch support. BUG=chromium:606718 BRANCH=gru TEST=Check with Cave that both mode works. Reviewed-on: https://chromium-review.googlesource.com/402089 Reviewed-by: Shawn N <shawnn@chromium.org> (cherry picked from commit c940f36ceabcf2425284001298f03ebdb4c3079e) Change-Id: I2ee5130f3e0a1307ec3ea543f7a32d66bc32b31d Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/404915 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/config.h5
-rw-r--r--include/motion_lid.h6
-rw-r--r--include/tablet_mode.h12
3 files changed, 17 insertions, 6 deletions
diff --git a/include/config.h b/include/config.h
index 797340ede3..5cc38a6c14 100644
--- a/include/config.h
+++ b/include/config.h
@@ -1819,6 +1819,11 @@
#undef CONFIG_SYSTEM_UNLOCKED
/*
+ * Device can be a tablet as well as a clamshell.
+ */
+#undef CONFIG_TABLET_MODE
+
+/*
* Add a virtual switch to indicate when we are in tablet mode.
*/
#undef CONFIG_TABLET_MODE_SWITCH
diff --git a/include/motion_lid.h b/include/motion_lid.h
index 405d5e5e5d..155c7735c9 100644
--- a/include/motion_lid.h
+++ b/include/motion_lid.h
@@ -46,12 +46,6 @@ int host_cmd_motion_lid(struct host_cmd_handler_args *args);
void motion_lid_calc(void);
-#ifdef CONFIG_LID_ANGLE_TABLET_MODE
-int motion_lid_in_tablet_mode(void);
-#else
-static inline int motion_lid_in_tablet_mode(void) { return 0; }
-#endif
-
#endif /* __CROS_EC_MOTION_LID_H */
diff --git a/include/tablet_mode.h b/include/tablet_mode.h
new file mode 100644
index 0000000000..6f4ee95e1e
--- /dev/null
+++ b/include/tablet_mode.h
@@ -0,0 +1,12 @@
+/* Copyright 2016 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.
+ */
+
+/* Header for tablet_mode.c */
+
+/* Return 1 if in tablet mode, 0 otherwise */
+int tablet_get_mode(void);
+void tablet_set_mode(int mode);
+
+