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>
This commit is contained in:
Daisuke Nojiri
2016-12-16 14:48:15 -08:00
committed by chrome-bot
parent 971e758dde
commit 2fac39df2d

View File

@@ -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] = {