diff options
author | Divya Sasidharan <divya.s.sasidharan@intel.com> | 2018-04-17 15:34:42 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-04-20 00:33:00 -0700 |
commit | 0521077d7b1463165d2438f1c6f8b371e0f1d922 (patch) | |
tree | caf37f3a4a6aa65340ab31ee237ac91c9b0c942b | |
parent | 60f45d28774d938c77c0f406c273dd54d180265b (diff) | |
download | chrome-ec-0521077d7b1463165d2438f1c6f8b371e0f1d922.tar.gz |
yorp: Fix force mode base accel config
Accel data read was (0, 0) without this change.
BUG=b:74602071
BRANCH=None
TEST=On yorp; on EC console test
accelinfo on -> gives accel data
Change-Id: I08073cccb2108b5d2189be5aa27a77adfae7677a
Signed-off-by: Divya Sasidharan <divya.s.sasidharan@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/1015974
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Divya S Sasidharan <divya.s.sasidharan@intel.com>
Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r-- | board/yorp/board.c | 9 | ||||
-rw-r--r-- | board/yorp/board.h | 3 |
2 files changed, 7 insertions, 5 deletions
diff --git a/board/yorp/board.c b/board/yorp/board.c index a0c7b1fd81..2b9fe53136 100644 --- a/board/yorp/board.c +++ b/board/yorp/board.c @@ -358,7 +358,8 @@ const matrix_3x3_t base_standard_ref = { /* sensor private data */ static struct kionix_accel_data g_kx022_data; -static struct stprivate_data g_lsm6dsm_data; +static struct stprivate_data lsm6dsm_g_data; +static struct stprivate_data lsm6dsm_a_data; /* Drivers */ /* TODO(b/74602071): Tune sensor cfg after the board is received */ @@ -396,7 +397,7 @@ struct motion_sensor_t motion_sensors[] = { .location = MOTIONSENSE_LOC_BASE, .drv = &lsm6dsm_drv, .mutex = &g_base_mutex, - .drv_data = &g_lsm6dsm_data, + .drv_data = &lsm6dsm_a_data, .port = I2C_PORT_SENSOR, .addr = LSM6DSM_ADDR0, .rot_standard_ref = &base_standard_ref, @@ -406,7 +407,7 @@ struct motion_sensor_t motion_sensors[] = { .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { - .odr = 10000 | ROUND_UP_FLAG, + .odr = 13000 | ROUND_UP_FLAG, .ec_rate = 100 * MSEC, }, /* Sensor on for angle detection */ @@ -425,7 +426,7 @@ struct motion_sensor_t motion_sensors[] = { .location = MOTIONSENSE_LOC_BASE, .drv = &lsm6dsm_drv, .mutex = &g_base_mutex, - .drv_data = &g_lsm6dsm_data, + .drv_data = &lsm6dsm_g_data, .port = I2C_PORT_SENSOR, .addr = LSM6DSM_ADDR0, .default_range = 1000, /* dps */ diff --git a/board/yorp/board.h b/board/yorp/board.h index 91605a6dfb..2fc76e3525 100644 --- a/board/yorp/board.h +++ b/board/yorp/board.h @@ -127,7 +127,8 @@ #define CONFIG_ACCEL_KX022 /* Lid accel */ #define CONFIG_ACCELGYRO_LSM6DSM /* Base accel */ /* Sensors without hardware FIFO are in forced mode */ -#define CONFIG_ACCEL_FORCE_MODE_MASK ((1 << LID_ACCEL)) +#define CONFIG_ACCEL_FORCE_MODE_MASK ((1 << LID_ACCEL) | \ + (1 << BASE_ACCEL) | (1 << BASE_GYRO)) #define CONFIG_LID_ANGLE #define CONFIG_LID_ANGLE_UPDATE |