summaryrefslogtreecommitdiff
path: root/common/ec_features.c
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2018-11-27 19:44:19 -0800
committerchrome-bot <chrome-bot@chromium.org>2018-11-29 04:31:50 -0800
commit7b3088705a977cabc736405f291b39510763aa44 (patch)
tree9e2ae837c479640e4a1f848f0bbf7290a8df819f /common/ec_features.c
parentba1f417b824cae748474a3a210d75f109f8a8473 (diff)
downloadchrome-ec-7b3088705a977cabc736405f291b39510763aa44.tar.gz
motion_lid: Allow host to configure tablet mode detection threshold
This change adds support for host to configure the tablet mode threshold angle and hysteresis degree using a new motionsense command MOTIONSENSE_CMD_TABLET_MODE_LID_ANGLE. Additionally, the EC sets a new feature bit to indicate support for this refined tablet mode detection. This feature bit can be used by kernel to expose an inclinometer device which can eventually help remove the redundant lid angle calculation in Chrome. BUG=b:120050761 BRANCH=octopus TEST=make -j buildall. Additionally, verified that tablet mode lid angle can be configured by host using ectool. Also, feature flag is correctly set to indicate support for this feature. Change-Id: I51bd160bbfae02d899bdf63096618c13eb5800e8 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/1351518 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'common/ec_features.c')
-rw-r--r--common/ec_features.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/ec_features.c b/common/ec_features.c
index ec483ad47f..b0f5876e92 100644
--- a/common/ec_features.c
+++ b/common/ec_features.c
@@ -128,6 +128,9 @@ uint32_t get_feature_flags1(void)
#ifdef CONFIG_ACCEL_FIFO
| EC_FEATURE_MASK_1(EC_FEATURE_MOTION_SENSE_TIGHT_TIMESTAMPS)
#endif
+#if defined(CONFIG_LID_ANGLE) && defined(CONFIG_TABLET_MODE)
+ | EC_FEATURE_MASK_1(EC_FEATURE_REFINED_TABLET_MODE_HYSTERESIS)
+#endif
;
#ifdef CONFIG_EC_FEATURE_BOARD_OVERRIDE
result = board_override_feature_flags1(result);