diff options
author | Justin TerAvest <teravest@chromium.org> | 2018-08-29 08:49:50 -0600 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-08-30 14:42:10 -0700 |
commit | 260907bf15752cef85fd89d8d5e3d2f61d4b4a8d (patch) | |
tree | 67f58244be93eff9af9b9d3485c2c7701a1c539e /board/bobba/board.c | |
parent | dfb04c7b51b2c467736932a24d811a2e3e43b6d2 (diff) | |
download | chrome-ec-260907bf15752cef85fd89d8d5e3d2f61d4b4a8d.tar.gz |
bobba: Add support for BMI160 base sensorsstabilize-11020.B
Starting with board_version 2, Bobba uses BMI160 instead of LSM6DSM for
base sensor support.
All Bobba boards with board_version < 2 should have SKU id set to 255,
and thus only have the lid sensor enabled. This change replaces the
LSM6DSM support with BMI160 support.
BUG=b:113369413
TEST=compile
BRANCH=none
Change-Id: Ib307e9c279162b445fb5fb8cae39b94bc401ecdb
Signed-off-by: Justin TerAvest <teravest@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1194880
Reviewed-by: Tino Liu <tino.liu@quanta.corp-partner.google.com>
Reviewed-by: Paris Yeh <pyeh@chromium.org>
Diffstat (limited to 'board/bobba/board.c')
-rw-r--r-- | board/bobba/board.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/board/bobba/board.c b/board/bobba/board.c index 7525cfefb8..3be6443893 100644 --- a/board/bobba/board.c +++ b/board/bobba/board.c @@ -14,7 +14,7 @@ #include "common.h" #include "cros_board_info.h" #include "driver/accel_kionix.h" -#include "driver/accelgyro_lsm6dsm.h" +#include "driver/accelgyro_bmi160.h" #include "driver/bc12/bq24392.h" #include "driver/charger/bd9995x.h" #include "driver/ppc/nx20p348x.h" @@ -117,8 +117,7 @@ const matrix_3x3_t base_standard_ref = { /* sensor private data */ static struct kionix_accel_data g_kx022_data; -static struct lsm6dsm_data lsm6dsm_g_data; -static struct lsm6dsm_data lsm6dsm_a_data; +static struct bmi160_drv_data_t g_bmi160_data; /* Drivers */ struct motion_sensor_t motion_sensors[] = { @@ -146,22 +145,21 @@ struct motion_sensor_t motion_sensors[] = { }, }, }, - [BASE_ACCEL] = { .name = "Base Accel", .active_mask = SENSOR_ACTIVE_S0_S3_S5, - .chip = MOTIONSENSE_CHIP_LSM6DSM, + .chip = MOTIONSENSE_CHIP_BMI160, .type = MOTIONSENSE_TYPE_ACCEL, .location = MOTIONSENSE_LOC_BASE, - .drv = &lsm6dsm_drv, + .drv = &bmi160_drv, .mutex = &g_base_mutex, - .drv_data = &lsm6dsm_a_data, + .drv_data = &g_bmi160_data, .port = I2C_PORT_SENSOR, - .addr = LSM6DSM_ADDR0, + .addr = BMI160_ADDR0, .rot_standard_ref = &base_standard_ref, .default_range = 4, /* g */ - .min_frequency = LSM6DSM_ODR_MIN_VAL, - .max_frequency = LSM6DSM_ODR_MAX_VAL, + .min_frequency = BMI160_ACCEL_MIN_FREQ, + .max_frequency = BMI160_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -175,22 +173,21 @@ struct motion_sensor_t motion_sensors[] = { }, }, }, - [BASE_GYRO] = { .name = "Base Gyro", .active_mask = SENSOR_ACTIVE_S0, - .chip = MOTIONSENSE_CHIP_LSM6DSM, + .chip = MOTIONSENSE_CHIP_BMI160, .type = MOTIONSENSE_TYPE_GYRO, .location = MOTIONSENSE_LOC_BASE, - .drv = &lsm6dsm_drv, + .drv = &bmi160_drv, .mutex = &g_base_mutex, - .drv_data = &lsm6dsm_g_data, + .drv_data = &g_bmi160_data, .port = I2C_PORT_SENSOR, - .addr = LSM6DSM_ADDR0, + .addr = BMI160_ADDR0, .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, - .min_frequency = LSM6DSM_ODR_MIN_VAL, - .max_frequency = LSM6DSM_ODR_MAX_VAL, + .min_frequency = BMI160_GYRO_MIN_FREQ, + .max_frequency = BMI160_GYRO_MAX_FREQ, }, }; |