From 2fac39df2d44d75da4c50db9ffd84c5e1db68168 Mon Sep 17 00:00:00 2001 From: Daisuke Nojiri Date: Fri, 16 Dec 2016 14:48:15 -0800 Subject: 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 Tested-by: Daisuke Nojiri Reviewed-by: Daisuke Nojiri --- board/reef/board.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'board/reef') 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] = { -- cgit v1.2.1