diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2015-05-12 07:45:33 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-05-12 23:35:51 +0000 |
commit | a9a9ae1abc4ddb6a89ee0d29b88fbdd1d2ef67b1 (patch) | |
tree | 26b9855187a83412b181009031878826faab8b97 /test/motion_lid.c | |
parent | 39bd18b890bb708e79e9ba50dd3b5bf3d35e9ff1 (diff) | |
download | chrome-ec-a9a9ae1abc4ddb6a89ee0d29b88fbdd1d2ef67b1.tar.gz |
driver: Use common data structure to store default accel values
Move structure used by lms6ds0 to motion_sense.h,
so that bosh driver can use the same mechanism.
Use code to avoid reading chip range when reading data.
BUG=none
BRANCH=none
TEST=Check Bosh driver is working as expected.
Change-Id: Id8b5bb8735e479a122ef32ab9a400fba189d7488
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/270453
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'test/motion_lid.c')
-rw-r--r-- | test/motion_lid.c | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/test/motion_lid.c b/test/motion_lid.c index a358a5056c..78ef019853 100644 --- a/test/motion_lid.c +++ b/test/motion_lid.c @@ -102,14 +102,36 @@ const matrix_3x3_t lid_standard_ref = { }; struct motion_sensor_t motion_sensors[] = { - {SENSOR_ACTIVE_S0_S3_S5, "base", MOTIONSENSE_CHIP_LSM6DS0, - MOTIONSENSE_TYPE_ACCEL, MOTIONSENSE_LOC_BASE, - &test_motion_sense, NULL, NULL, - 0, &base_standard_ref, 119000, 2}, - {SENSOR_ACTIVE_S0, "lid", MOTIONSENSE_CHIP_KXCJ9, - MOTIONSENSE_TYPE_ACCEL, MOTIONSENSE_LOC_LID, - &test_motion_sense, NULL, NULL, - 0, &lid_standard_ref, 100000, 2}, + {.name = "base", + .active_mask = SENSOR_ACTIVE_S0_S3_S5, + .chip = MOTIONSENSE_CHIP_LSM6DS0, + .type = MOTIONSENSE_TYPE_ACCEL, + .location = MOTIONSENSE_LOC_BASE, + .drv = &test_motion_sense, + .mutex = NULL, + .drv_data = NULL, + .i2c_addr = 0, + .rot_standard_ref = &base_standard_ref, + .default_config = { + .odr = 119000, + .range = 2 + } + }, + {.name = "base", + .active_mask = SENSOR_ACTIVE_S0, + .chip = MOTIONSENSE_CHIP_KXCJ9, + .type = MOTIONSENSE_TYPE_ACCEL, + .location = MOTIONSENSE_LOC_LID, + .drv = &test_motion_sense, + .mutex = NULL, + .drv_data = NULL, + .i2c_addr = 0, + .rot_standard_ref = &lid_standard_ref, + .default_config = { + .odr = 119000, + .range = 2 + } + }, }; const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); |