From 9a0d0aa70d483be79c71a459dfd5f5e89da2638d Mon Sep 17 00:00:00 2001 From: Nick Vaccaro Date: Tue, 25 Apr 2017 19:09:03 -0700 Subject: common: sensors: add extra sensor attributes Adds min_frequency and max_frequency to struct motion_sensor_t. New attributes min_frequency and max_frequency are now returned in ectool's MOTIONSENSE_CMD_INFO response. Incremented ectool's MOTIONSENSE_CMD_INFO version to version 3. Add constants for MIN_FREQUENCY and MAX_FREQUENCY to each sensor's header file. BRANCH=none BUG=chromium:615059 TEST=build/boot and verify MOTIONSENSE_CMD_INFO response on kevin, make buildall -j passes. Change-Id: I66db9715c122ef6bb4665ad5d086a9ecc9c7c93a Signed-off-by: Nick Vaccaro Reviewed-on: https://chromium-review.googlesource.com/482703 Reviewed-by: Aseda Aboagye --- board/samus/board.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'board/samus') diff --git a/board/samus/board.c b/board/samus/board.c index d6523c57bb..62aebc32f2 100644 --- a/board/samus/board.c +++ b/board/samus/board.c @@ -316,6 +316,8 @@ struct motion_sensor_t motion_sensors[] = { .addr = LSM6DS0_ADDR1, .rot_standard_ref = &base_standard_ref, .default_range = 2, /* g, enough for laptop. */ + .min_frequency = LSM6DS0_ACCEL_MIN_FREQ, + .max_frequency = LSM6DS0_ACCEL_MAX_FREQ, .config = { /* AP: by default shutdown all sensors */ [SENSOR_CONFIG_AP] = { @@ -351,6 +353,8 @@ struct motion_sensor_t motion_sensors[] = { .addr = KXCJ9_ADDR0, .rot_standard_ref = &lid_standard_ref, .default_range = 2, /* g, enough for laptop. */ + .min_frequency = KXCJ9_ACCEL_MIN_FREQ, + .max_frequency = KXCJ9_ACCEL_MAX_FREQ, .config = { /* AP: by default shutdown all sensors */ [SENSOR_CONFIG_AP] = { @@ -386,6 +390,8 @@ struct motion_sensor_t motion_sensors[] = { .addr = LSM6DS0_ADDR1, .rot_standard_ref = NULL, .default_range = 2000, /* g, enough for laptop. */ + .min_frequency = LSM6DS0_GYRO_MIN_FREQ, + .max_frequency = LSM6DS0_GYRO_MAX_FREQ, .config = { /* AP: by default shutdown all sensors */ [SENSOR_CONFIG_AP] = { -- cgit v1.2.1