summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2018-11-25 17:48:19 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2018-11-30 18:33:32 +0000
commit60982b93aa7aca5a8c366b2c044482fbf9d7eb79 (patch)
tree28ed16968d93ccae30ff894dff85c664af1553de /common
parentb61fed47e2f46c9ffdea6e49ffcbe7cc9bb3f3c2 (diff)
downloadchrome-ec-60982b93aa7aca5a8c366b2c044482fbf9d7eb79.tar.gz
motion_lid: Set tablet mode at 180 degree
This change aligns tablet mode detection in EC to match the behavior of Chrome. When lid angle goes beyond 200 degree, tablet mode is set to 1. On the other hand, tablet mode is set to 0 when lid angle goes below 160 degree. BUG=b:120050761 BRANCH=None TEST=make -j buildall. Verified that EC reports tablet mode close to 180 degrees. Change-Id: If20a8e7545683b2a01f401f7db8d7973e70deb14 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/1350472 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> (cherry picked from commit ba1f417b824cae748474a3a210d75f109f8a8473) Reviewed-on: https://chromium-review.googlesource.com/c/1356837 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Tested-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/motion_lid.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/common/motion_lid.c b/common/motion_lid.c
index 8d150e3b65..d737046c53 100644
--- a/common/motion_lid.c
+++ b/common/motion_lid.c
@@ -135,18 +135,18 @@ __attribute__((weak)) int board_is_lid_angle_tablet_mode(void)
* - when lid is closed while the hinge is perpendicular to the floor, we will
* stay in tablet mode.
*
- * Tablet mode is defined as the base being behind the lid. We use 2 threshold
- * to calculate tablet mode:
+ * Tablet mode is defined as the lid angle being greater than 180 degree. We use
+ * 2 threshold to calculate tablet mode:
* tablet_mode:
- * 1 | +-----<----+----------
- * | \/ /\
- * | | |
- * 0 |------------------------>----+
- * +------------------+----------+----------+ lid angle
- * 0 240 300 360
+ * 1 | +-----<----+----------
+ * | \/ /\
+ * | | |
+ * 0 |------------------>----+
+ * +------------+----------+----------+ lid angle
+ * 0 160 200 360
*/
-#define TABLET_ZONE_LID_ANGLE FLOAT_TO_FP(300)
-#define LAPTOP_ZONE_LID_ANGLE FLOAT_TO_FP(240)
+#define TABLET_ZONE_LID_ANGLE FLOAT_TO_FP(200)
+#define LAPTOP_ZONE_LID_ANGLE FLOAT_TO_FP(160)
/*
* We will change our tablet mode status when we are "convinced" that it has