summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce <Bruce.Wan@quantatw.com>2017-01-05 14:40:16 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-01-06 05:40:36 -0800
commite8b252c738046b9426181112409e4f591fa48616 (patch)
tree0c9a186c09a7806e749ce5c611b71ac26532c2b6
parentc6928bce0b896d6c34f386e72a859060cc59ac93 (diff)
downloadchrome-ec-e8b252c738046b9426181112409e4f591fa48616.tar.gz
pyro/snappy: enable/disable KB and TP function in S3stabilize-9157.B
In S3 state, then disable KB/TP function when state switch to tablet mode from normal mode.Enable KB/TP function when state switch to nromal mode from tablet mode. BUG=none BRANCH=reef TEST=make buildall Change-Id: If759504b6d471ddc18f322aeda07ccbd6ccd636e Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/425416 Commit-Ready: Bruce Wan <Bruce.Wan@quantatw.com> Tested-by: Bruce Wan <Bruce.Wan@quantatw.com> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r--board/pyro/board.c23
-rw-r--r--board/snappy/board.c23
2 files changed, 34 insertions, 12 deletions
diff --git a/board/pyro/board.c b/board/pyro/board.c
index 8a10409d10..da92264951 100644
--- a/board/pyro/board.c
+++ b/board/pyro/board.c
@@ -682,6 +682,17 @@ void lid_angle_peripheral_enable(int enable)
enable = 0;
keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE);
gpio_set_level(GPIO_EN_P3300_TRACKPAD_ODL, !enable);
+
+ /*
+ * In S3 state, then disable KB/TP function
+ * when state switch to tablet mode from normal mode.
+ * Enable KB/TP function when state switch to nromal
+ * mode from tablet mode.
+ */
+ if (chipset_in_state(CHIPSET_STATE_SUSPEND)) {
+ keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE);
+ gpio_set_level(GPIO_EN_P3300_TRACKPAD_ODL, !enable);
+ }
}
#endif
@@ -796,7 +807,7 @@ struct bmp280_drv_data_t bmp280_drv_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,
@@ -820,8 +831,8 @@ struct motion_sensor_t motion_sensors[] = {
},
/* unused */
[SENSOR_CONFIG_EC_S3] = {
- .odr = 0,
- .ec_rate = 0,
+ .odr = 10000 | ROUND_UP_FLAG,
+ .ec_rate = 100 * MSEC,
},
[SENSOR_CONFIG_EC_S5] = {
.odr = 0,
@@ -832,7 +843,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,
@@ -856,8 +867,8 @@ struct motion_sensor_t motion_sensors[] = {
},
/* Sensor off in S3/S5 */
[SENSOR_CONFIG_EC_S3] = {
- .odr = 0,
- .ec_rate = 0
+ .odr = 0 | ROUND_UP_FLAG,
+ .ec_rate = 100 * MSEC,
},
/* Sensor off in S3/S5 */
[SENSOR_CONFIG_EC_S5] = {
diff --git a/board/snappy/board.c b/board/snappy/board.c
index d2f62edf8a..5ae425f6bb 100644
--- a/board/snappy/board.c
+++ b/board/snappy/board.c
@@ -681,6 +681,17 @@ void lid_angle_peripheral_enable(int enable)
enable = 0;
keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE);
gpio_set_level(GPIO_EN_P3300_TRACKPAD_ODL, !enable);
+
+ /*
+ * In S3 state, then disable KB/TP function
+ * when state switch to tablet mode from normal mode.
+ * Enable KB/TP function when state switch to nromal
+ * mode from tablet mode.
+ */
+ if (chipset_in_state(CHIPSET_STATE_SUSPEND)) {
+ keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE);
+ gpio_set_level(GPIO_EN_P3300_TRACKPAD_ODL, !enable);
+ }
}
#endif
@@ -796,7 +807,7 @@ struct bmp280_drv_data_t bmp280_drv_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,
@@ -820,8 +831,8 @@ struct motion_sensor_t motion_sensors[] = {
},
/* unused */
[SENSOR_CONFIG_EC_S3] = {
- .odr = 0,
- .ec_rate = 0,
+ .odr = 10000 | ROUND_UP_FLAG,
+ .ec_rate = 100 * MSEC,
},
[SENSOR_CONFIG_EC_S5] = {
.odr = 0,
@@ -832,7 +843,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,
@@ -856,8 +867,8 @@ struct motion_sensor_t motion_sensors[] = {
},
/* Sensor off in S3/S5 */
[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] = {