diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2016-12-16 14:48:15 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-12-21 19:42:51 -0800 |
commit | 2fac39df2d44d75da4c50db9ffd84c5e1db68168 (patch) | |
tree | fbd8d4f127f2053f7527734a71d979a05a126c75 | |
parent | 971e758ddec1b04b4a5479d716ec5a53ea48950f (diff) | |
download | chrome-ec-2fac39df2d44d75da4c50db9ffd84c5e1db68168.tar.gz |
Electro: Enable accels in S3
This patch enables accels in S3. Accels are required to calculate a
lid angle. EC enables/disables keyboard based on lid angles. EC
needs to be able to control it because the kernel is in sleep state
in S3.
BUG=chrome-os-partner:58792
BRANCH=reef
TEST=lid angles are calculated correctly in S0 and S3.
Change-Id: I13c69a47da2c6521cd0c03c66cf061deb3f4fabd
Reviewed-on: https://chromium-review.googlesource.com/421276
Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r-- | board/reef/board.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/board/reef/board.c b/board/reef/board.c index e7d433a89f..4561842b8d 100644 --- a/board/reef/board.c +++ b/board/reef/board.c @@ -787,7 +787,7 @@ struct kionix_accel_data g_kx022_data; struct motion_sensor_t motion_sensors[] = { [LID_ACCEL] = { .name = "Lid Accel", - .active_mask = SENSOR_ACTIVE_S0, + .active_mask = SENSOR_ACTIVE_S0_S3, .chip = MOTIONSENSE_CHIP_KX022, .type = MOTIONSENSE_TYPE_ACCEL, .location = MOTIONSENSE_LOC_LID, @@ -807,11 +807,11 @@ struct motion_sensor_t motion_sensors[] = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { .odr = 10000 | ROUND_UP_FLAG, - .ec_rate = 100 * MSEC, + .ec_rate = 0, }, - /* unused */ + /* Sensor on for lid angle detection */ [SENSOR_CONFIG_EC_S3] = { - .odr = 0, + .odr = 10000 | ROUND_UP_FLAG, .ec_rate = 0, }, [SENSOR_CONFIG_EC_S5] = { @@ -823,7 +823,7 @@ struct motion_sensor_t motion_sensors[] = { [BASE_ACCEL] = { .name = "Base Accel", - .active_mask = SENSOR_ACTIVE_S0, + .active_mask = SENSOR_ACTIVE_S0_S3, .chip = MOTIONSENSE_CHIP_BMI160, .type = MOTIONSENSE_TYPE_ACCEL, .location = MOTIONSENSE_LOC_BASE, @@ -845,10 +845,10 @@ struct motion_sensor_t motion_sensors[] = { .odr = 10000 | ROUND_UP_FLAG, .ec_rate = 100 * MSEC, }, - /* Sensor off in S3/S5 */ + /* Sensor on for lid angle detection */ [SENSOR_CONFIG_EC_S3] = { - .odr = 0, - .ec_rate = 0 + .odr = 10000 | ROUND_UP_FLAG, + .ec_rate = 100 * MSEC, }, /* Sensor off in S3/S5 */ [SENSOR_CONFIG_EC_S5] = { |