From 242f1957714153075e2eb9d5541923d28f05ec7c Mon Sep 17 00:00:00 2001 From: Alec Berg Date: Fri, 14 Mar 2014 09:27:31 -0700 Subject: rambi: glimmer: Disable key scanning in suspend when lid is open Added ability to disable the keyboard to wake from suspend when the lid is outside a certain angle range. This has been added to glimmer by defining CONFIG_LID_ANGLE_KEY_SCAN in its board.h. Also modified the lid angle calculation to include a reliability flag which can be used to tell when the hinge aligns too closely with gravity and the lid angle value is unreliable. BUG=none BRANCH=rambi TEST=Tested on a glimmer: In S3, verified that when the lid is open past ~180 deg, the keyboard does not wake the machine. Also verified that if you align hinge with gravity, the keyboard enabled/disabled status remains the same (since we can't actually trust the lid angle value). Change-Id: I45b2c7c3c4bbcae61d3a0f8b5baa461ab8dabfb0 Original-Change-Id: If1a1592d259902d38941936961854b81b3a75b95 Signed-off-by: Alec Berg Reviewed-on: https://chromium-review.googlesource.com/190061 Reviewed-on: https://chromium-review.googlesource.com/191612 Reviewed-by: Randall Spangler --- include/lid_angle.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 include/lid_angle.h (limited to 'include/lid_angle.h') diff --git a/include/lid_angle.h b/include/lid_angle.h new file mode 100644 index 0000000000..bd60b90907 --- /dev/null +++ b/include/lid_angle.h @@ -0,0 +1,20 @@ +/* Copyright (c) 2014 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. + */ + +/* Lid angle module for Chrome EC */ + +#ifndef __CROS_EC_LID_ANGLE_H +#define __CROS_EC_LID_ANGLE_H + +/** + * Update the lid angle module with the most recent lid angle calculation. Then + * use the lid angle history to enable/disable keyboard scanning when chipset + * is suspended. + * + * @lid_ang Lid angle. + */ +void lidangle_keyscan_update(float lid_ang); + +#endif /* __CROS_EC_LID_ANGLE_H */ -- cgit v1.2.1