summaryrefslogtreecommitdiff
path: root/include/lid_angle.h
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2014-04-08 10:28:29 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-04-11 04:00:44 +0000
commiteaa645e0cc092fbaaa1a81ed5308831e71ebf86c (patch)
treeebf92cd466682ee38fc2d0f5caa801d6e8a3d431 /include/lid_angle.h
parent335ad0c397f61d81d7fb5db8e3fb24e9bc089a2d (diff)
downloadchrome-ec-eaa645e0cc092fbaaa1a81ed5308831e71ebf86c.tar.gz
accel: Add host cmd for setting lid angle threshold for disabling keyboard wake
Added a sub-command to the motionsense host command (0x2b) for getting/setting the lid angle at which the keyboard is disabled as a wake source in S3. The value can be anywhere from 0 to 360 degrees, default set to 180. Note, this only takes affect for boards that have CONFIG_LID_ANGLE_KEY_SCAN defined. Modified ectool motionsense command to use new host sub-command. Also modified the lid angle measurement in the EC to be in the range [0, 360], instead of [-180, 180], and changed casting of lid angle as an int to round to nearest. BUG=none BRANCH=rambi TEST=Tested on a glimmer: Using default keyboard disable lid angle of 180, made sure that when lid angle is past 180, key presses do not wake system, and when lid angle is less than 180, key presses do wake up system. Used ectool motionsense kb_wake to set the keyboard disable lid angle to 0. Made sure that keyboard never wakes up the system. Set keyboard disable lid angle to 360 and made sure that the keyboard always wakes up the system. Change-Id: I437164c6e38c29169ef6e20e86c9cf2a1c78f86e Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/193663 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/194172
Diffstat (limited to 'include/lid_angle.h')
-rw-r--r--include/lid_angle.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/lid_angle.h b/include/lid_angle.h
index bd60b90907..cd13265c93 100644
--- a/include/lid_angle.h
+++ b/include/lid_angle.h
@@ -17,4 +17,12 @@
*/
void lidangle_keyscan_update(float lid_ang);
+/**
+ * Getter and setter methods for the keyboard wake angle. In S3, when the
+ * lid angle is greater than this value, the keyboard is disabled, and when
+ * the lid angle is smaller than this value, the keyboard is enabled.
+ */
+int lid_angle_get_kb_wake_angle(void);
+void lid_angle_set_kb_wake_angle(int ang);
+
#endif /* __CROS_EC_LID_ANGLE_H */