Files
OpenCellular/include/lid_angle.h
Alec Berg eaa645e0cc 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
2014-04-11 04:00:44 +00:00

29 lines
878 B
C

/* 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);
/**
* 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 */