summaryrefslogtreecommitdiff
path: root/test/motion_lid.c
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2015-10-23 10:50:23 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-10-28 00:23:48 -0700
commit21c46e7b1300022fcee1e5997b3e9293c47c27ea (patch)
tree391f5fb1eeb32a85d054ada31b081840ab5654e7 /test/motion_lid.c
parent7253e57b3c5f415d53558d8e8266c70ff42975a7 (diff)
downloadchrome-ec-21c46e7b1300022fcee1e5997b3e9293c47c27ea.tar.gz
motion: Remove duplicate shutdown code
Call shutdown() entry point at init() and remove duplicate code. shutdown would init the sensor so they would be ready if needed. Set S5 flag to include G3 (hard off) state, not only S5 (soft off). BUG=chrome-os-partner:45722 BRANCH=smaug TEST=When doing a RO->RW transition while AP is in G3, check the sensors are initialized properly. This issue was found while testng the magic sequence code. Change-Id: I647f83580240bf5ba0c340fca3184220abe4c12e Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/308561 Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'test/motion_lid.c')
-rw-r--r--test/motion_lid.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/motion_lid.c b/test/motion_lid.c
index ba6a179b1c..158fcb0918 100644
--- a/test/motion_lid.c
+++ b/test/motion_lid.c
@@ -196,12 +196,14 @@ static int test_lid_angle(void)
struct motion_sensor_t *base = &motion_sensors[0];
struct motion_sensor_t *lid = &motion_sensors[1];
- /* Go to S3 state */
+ /* We don't have TASK_CHIP so simulate init ourselves */
+ hook_notify(HOOK_CHIPSET_SHUTDOWN);
TEST_ASSERT(sensor_active == SENSOR_ACTIVE_S5);
TEST_ASSERT(accel_get_data_rate(lid) == 0);
TEST_ASSERT(motion_interval == 0);
/* Go to S0 state */
+ hook_notify(HOOK_CHIPSET_SUSPEND);
hook_notify(HOOK_CHIPSET_RESUME);
msleep(1000);
TEST_ASSERT(sensor_active == SENSOR_ACTIVE_S0);