summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSheng-Liang Song <ssl@chromium.org>2014-09-29 11:38:40 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-10-08 02:51:17 +0000
commitac261c00c1b28c549a13aa54bac62b423d10fc6c (patch)
tree4354aa9ce74f90df73621d499f5985d3d099727d /test
parentc5b30aa9f2fa726ec77a825a5bc04f985d584ec5 (diff)
downloadchrome-ec-ac261c00c1b28c549a13aa54bac62b423d10fc6c.tar.gz
samus: support sensor at different power state.
Design Goals: 1. Every time the AP boots, the same default sensor settings are configured. 2. If the AP goes to suspend (S3) and wakes back up (S0), then the AP sensor settings will be restored. 3. In S3 and in S5, only sample specific sensors that are needed. BUG=chrome-os-partner:32368 BRANCH=ToT TEST=Verified on Samus. Verified suspend and resume logic with EC console messages. - Test Case0: close lid & open lid - Test Case1: powerd_dbus_suspend Change-Id: I553c53e63ecfcb39d5e649a7189aa6ea02589471 Signed-off-by: Sheng-Liang Song <ssl@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/220371 Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'test')
-rw-r--r--test/motion_sense.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/test/motion_sense.c b/test/motion_sense.c
index b9a928ef8c..5148935533 100644
--- a/test/motion_sense.c
+++ b/test/motion_sense.c
@@ -89,10 +89,14 @@ const struct accelgyro_drv test_motion_sense = {
};
struct motion_sensor_t motion_sensors[] = {
- {"base", SENSOR_CHIP_LSM6DS0, SENSOR_ACCELEROMETER, LOCATION_BASE,
- &test_motion_sense, NULL, NULL, 0},
- {"lid", SENSOR_CHIP_KXCJ9, SENSOR_ACCELEROMETER, LOCATION_LID,
- &test_motion_sense, NULL, NULL, 0},
+ {SENSOR_ACTIVE_S0_S3_S5, "base", SENSOR_CHIP_LSM6DS0,
+ SENSOR_ACCELEROMETER, LOCATION_BASE,
+ &test_motion_sense, NULL, NULL,
+ 0, 119000, 2},
+ {SENSOR_ACTIVE_S0, "lid", SENSOR_CHIP_KXCJ9,
+ SENSOR_ACCELEROMETER, LOCATION_LID,
+ &test_motion_sense, NULL, NULL,
+ 0, 100000, 2},
};
const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
@@ -106,8 +110,12 @@ 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 */
hook_notify(HOOK_CHIPSET_STARTUP);
+ /* Go to S0 state */
+ hook_notify(HOOK_CHIPSET_RESUME);
+
/*
* Set the base accelerometer as if it were sitting flat on a desk
* and set the lid to closed.