diff options
author | Ching-Kang Yen <chingkang@chromium.org> | 2020-04-16 23:57:17 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-10-12 15:10:31 +0000 |
commit | 2e061c1d0b63f273a68fa802d2f19a6bcbe62c13 (patch) | |
tree | a573680698e987bc39586801d1800e0df04a9f50 | |
parent | b9124243c52d6ac5a7d687da581724025fe090cf (diff) | |
download | chrome-ec-2e061c1d0b63f273a68fa802d2f19a6bcbe62c13.tar.gz |
driver: Replace BMI160 to BMI in board config
Replace some macro of BMI160 to BMI version for common function of
BMI series.
Make board config include the accelgyro_bmi_common.h instead of
accel_gyro_bmi160.h.
BRANCH=None
BUG=b:146144827
TEST=make buildall -j
Conflicts:
Changed many board.c files, which were diverted from the branch
point. Some boards do not exist in this branch.
Change-Id: I043ff8a92f15295ead3fa5c1e292319e2b4fa21a
Signed-off-by: Ching-Kang Yen <chingkang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2156525
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
(cherry picked from commit 557dafbacbc61cd4c5dec9f27ead4ea17b67aac6)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3115727
Tested-by: Rong Chang <rongchang@chromium.org>
Auto-Submit: Rong Chang <rongchang@chromium.org>
Commit-Queue: Rong Chang <rongchang@chromium.org>
51 files changed, 250 insertions, 296 deletions
diff --git a/baseboard/grunt/baseboard.c b/baseboard/grunt/baseboard.c index 18b5f80767..42eed9ef18 100644 --- a/baseboard/grunt/baseboard.c +++ b/baseboard/grunt/baseboard.c @@ -17,7 +17,7 @@ #include "cros_board_info.h" #include "driver/accel_kionix.h" #include "driver/accel_kx022.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/bc12/max14637.h" #include "driver/ppc/sn5s330.h" #include "driver/tcpm/anx7447.h" @@ -537,7 +537,7 @@ static struct mutex g_base_mutex; /* sensor private data */ static struct kionix_accel_data g_kx022_data; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; /* TODO(gcc >= 5.0) Remove the casts to const pointer at rot_standard_ref */ struct motion_sensor_t motion_sensors[] = { @@ -582,8 +582,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 2, /* g, enough for laptop */ .rot_standard_ref = NULL, - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -610,8 +610,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ .rot_standard_ref = NULL, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, }; diff --git a/baseboard/zork/baseboard.c b/baseboard/zork/baseboard.c index 8b931f9bb1..fb8a9be419 100644 --- a/baseboard/zork/baseboard.c +++ b/baseboard/zork/baseboard.c @@ -15,9 +15,7 @@ #include "compile_time_macros.h" #include "console.h" #include "cros_board_info.h" -#include "driver/accel_kionix.h" -#include "driver/accel_kx022.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/bc12/pi3usb9201.h" #include "driver/ppc/aoz1380.h" #include "driver/ppc/nx20p348x.h" @@ -608,7 +606,7 @@ static struct mutex g_base_mutex; /* sensor private data */ static struct kionix_accel_data g_kx022_data; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; /* TODO(gcc >= 5.0) Remove the casts to const pointer at rot_standard_ref */ struct motion_sensor_t motion_sensors[] = { @@ -653,8 +651,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 2, /* g, enough for laptop */ .rot_standard_ref = NULL, - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -681,8 +679,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ .rot_standard_ref = NULL, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, }; diff --git a/board/aleena/board.c b/board/aleena/board.c index d648b32f02..f5b3485354 100644 --- a/board/aleena/board.c +++ b/board/aleena/board.c @@ -6,7 +6,7 @@ /* Aleena board-specific configuration */ #include "button.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/led/lm3630a.h" #include "extpower.h" #include "hooks.h" diff --git a/board/ampton/board.c b/board/ampton/board.c index 9dfa1e1db8..1f4e60ab3b 100644 --- a/board/ampton/board.c +++ b/board/ampton/board.c @@ -12,7 +12,7 @@ #include "common.h" #include "cros_board_info.h" #include "driver/accel_kionix.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/ppc/sn5s330.h" #include "driver/sync.h" #include "driver/tcpm/it83xx_pd.h" @@ -174,7 +174,7 @@ const mat33_fp_t gyro_standard_ref = { /* sensor private data */ static struct kionix_accel_data g_kx022_data; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; /* Drivers */ struct motion_sensor_t motion_sensors[] = { @@ -217,8 +217,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .rot_standard_ref = &base_standard_ref, .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -245,8 +245,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ .rot_standard_ref = &gyro_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, [VSYNC] = { .name = "Camera VSYNC", diff --git a/board/bobba/board.c b/board/bobba/board.c index a89f63681b..f0fb23edd3 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_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/charger/bd9995x.h" #include "driver/ppc/nx20p348x.h" #include "driver/sync.h" @@ -154,7 +154,7 @@ const mat33_fp_t base_ar_cam_ref = { /* sensor private data */ static struct kionix_accel_data g_kx022_data; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; /* Drivers */ struct motion_sensor_t motion_sensors[] = { @@ -197,8 +197,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .rot_standard_ref = &base_standard_ref, .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -225,8 +225,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, [VSYNC] = { .name = "Camera VSYNC", diff --git a/board/burnet/board.c b/board/burnet/board.c index fd4871c159..2ece6977e2 100644 --- a/board/burnet/board.c +++ b/board/burnet/board.c @@ -16,7 +16,7 @@ #include "console.h" #include "driver/accel_bma2x2.h" #include "driver/accel_kionix.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/accelgyro_icm_common.h" #include "driver/accelgyro_icm426xx.h" #include "driver/battery/max17055.h" @@ -324,7 +324,7 @@ static const mat33_fp_t base_icm426xx_ref = { /* sensor private data */ static struct accelgyro_saved_data_t g_bma253_data; static struct kionix_accel_data g_kx022_data; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; static struct icm_drv_data_t g_icm426xx_data; struct motion_sensor_t lid_accel_kx022 = { @@ -437,8 +437,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = SLAVE_MK_SPI_ADDR_FLAGS(CONFIG_SPI_ACCEL_PORT), .rot_standard_ref = &base_bmi160_ref, .default_range = 2, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -465,8 +465,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = SLAVE_MK_SPI_ADDR_FLAGS(CONFIG_SPI_ACCEL_PORT), .default_range = 1000, /* dps */ .rot_standard_ref = &base_bmi160_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, }; unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); diff --git a/board/cerise/board.c b/board/cerise/board.c index 4d449496c1..f52bbb1d6e 100644 --- a/board/cerise/board.c +++ b/board/cerise/board.c @@ -15,7 +15,7 @@ #include "common.h" #include "console.h" #include "driver/accel_lis2dw12.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/battery/max17055.h" #include "driver/bc12/pi3usb9201.h" #include "driver/charger/isl923x.h" @@ -335,7 +335,7 @@ static const mat33_fp_t lid_standard_ref = { /* Lid accel private data */ static struct stprivate_data g_lis2dwl_data; /* Base accel private data */ -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; struct motion_sensor_t motion_sensors[] = { [LID_ACCEL] = { @@ -382,8 +382,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = SLAVE_MK_SPI_ADDR_FLAGS(CONFIG_SPI_ACCEL_PORT), .rot_standard_ref = &base_standard_ref, .default_range = 2, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -410,8 +410,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = SLAVE_MK_SPI_ADDR_FLAGS(CONFIG_SPI_ACCEL_PORT), .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, }; const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); diff --git a/board/cheza/board.c b/board/cheza/board.c index 1742b9d4a2..810df45924 100644 --- a/board/cheza/board.c +++ b/board/cheza/board.c @@ -12,7 +12,7 @@ #include "charge_state.h" #include "chipset.h" #include "extpower.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/als_opt3001.h" #include "driver/ppc/sn5s330.h" #include "driver/tcpm/anx74xx.h" @@ -619,7 +619,7 @@ uint16_t tcpc_get_alert_status(void) /* Mutexes */ static struct mutex g_lid_mutex; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; static struct opt3001_drv_data_t g_opt3001_data = { .scale = 1, .uscale = 0, @@ -652,8 +652,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .rot_standard_ref = &base_standard_ref, .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { [SENSOR_CONFIG_EC_S0] = { .odr = 10000 | ROUND_UP_FLAG, @@ -673,8 +673,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, [LID_ALS] = { .name = "Light", diff --git a/board/coral/board.c b/board/coral/board.c index 021343851c..679c5b72a3 100644 --- a/board/coral/board.c +++ b/board/coral/board.c @@ -17,7 +17,7 @@ #include "driver/als_opt3001.h" #include "driver/accel_kionix.h" #include "driver/accel_kx022.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/charger/bd9995x.h" #include "driver/tcpm/anx74xx.h" #include "driver/tcpm/ps8xxx.h" @@ -709,7 +709,7 @@ const mat33_fp_t mag_standard_ref = { /* sensor private data */ static struct kionix_accel_data g_kx022_data; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; /* FIXME(dhendrix): Copied from Amenia, probably need to tweak for Coral */ struct motion_sensor_t motion_sensors[] = { @@ -753,8 +753,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .rot_standard_ref = &base_standard_ref, .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -782,8 +782,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, }; unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); diff --git a/board/damu/board.c b/board/damu/board.c index 4721f857ca..c0ce68c309 100644 --- a/board/damu/board.c +++ b/board/damu/board.c @@ -15,7 +15,7 @@ #include "common.h" #include "console.h" #include "driver/accel_lis2dw12.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/battery/max17055.h" #include "driver/bc12/pi3usb9201.h" #include "driver/charger/isl923x.h" @@ -332,7 +332,7 @@ static const mat33_fp_t lid_standard_ref = { /* Lid accel private data */ static struct stprivate_data g_lis2dwl_data; /* Base accel private data */ -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; struct motion_sensor_t motion_sensors[] = { [LID_ACCEL] = { @@ -379,8 +379,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = SLAVE_MK_SPI_ADDR_FLAGS(CONFIG_SPI_ACCEL_PORT), .rot_standard_ref = &base_standard_ref, .default_range = 2, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -407,8 +407,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = SLAVE_MK_SPI_ADDR_FLAGS(CONFIG_SPI_ACCEL_PORT), .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, }; const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); diff --git a/board/dood/board.c b/board/dood/board.c index de51648b88..decb7003b6 100644 --- a/board/dood/board.c +++ b/board/dood/board.c @@ -14,7 +14,7 @@ #include "common.h" #include "cros_board_info.h" #include "driver/accel_kionix.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/charger/bd9995x.h" #include "driver/ppc/nx20p348x.h" #include "driver/sync.h" @@ -137,7 +137,7 @@ const mat33_fp_t base_standard_ref = { /* sensor private data */ static struct kionix_accel_data g_kx022_data; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; /* Drivers */ struct motion_sensor_t motion_sensors[] = { @@ -180,8 +180,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .rot_standard_ref = &base_standard_ref, .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -208,8 +208,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, }; diff --git a/board/dratini/board.c b/board/dratini/board.c index 7829ceec79..bbf3a2be34 100644 --- a/board/dratini/board.c +++ b/board/dratini/board.c @@ -11,7 +11,7 @@ #include "common.h" #include "cros_board_info.h" #include "driver/accel_bma2x2.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/als_tcs3400.h" #include "driver/bc12/pi3usb9201.h" #include "driver/ppc/sn5s330.h" @@ -175,7 +175,7 @@ static struct mutex g_base_mutex; static struct mutex g_lid_mutex; /* Base accel private data */ -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; /* BMA255 private data */ static struct accelgyro_saved_data_t g_bma255_data; @@ -238,8 +238,8 @@ struct motion_sensor_t motion_sensors[] = { .port = I2C_PORT_ACCEL, .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ .config = { [SENSOR_CONFIG_EC_S0] = { @@ -265,8 +265,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, }; unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); diff --git a/board/eve/board.c b/board/eve/board.c index 42ff73643f..cc7c8004a5 100644 --- a/board/eve/board.c +++ b/board/eve/board.c @@ -19,7 +19,7 @@ #include "device_event.h" #include "driver/accel_kionix.h" #include "driver/accel_kxcj9.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/als_si114x.h" #include "driver/charger/bd9995x.h" #include "driver/tcpm/anx74xx.h" @@ -772,7 +772,7 @@ static struct mutex g_base_mutex; static struct mutex g_lid_mutex; static struct kionix_accel_data g_kxcj9_data; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; static struct si114x_drv_data_t g_si114x_data = { .state = SI114X_NOT_READY, @@ -845,8 +845,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .rot_standard_ref = NULL, .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -879,8 +879,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ .rot_standard_ref = NULL, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, [BASE_MAG] = { diff --git a/board/eve/board.h b/board/eve/board.h index 5f482f67ac..0cf1c392a6 100644 --- a/board/eve/board.h +++ b/board/eve/board.h @@ -123,7 +123,7 @@ #define CONFIG_TEMP_SENSOR_BD99992GW #define CONFIG_THERMISTOR_NCP15WB #define CONFIG_ACCELGYRO_BMI160 -#define CONFIG_MAG_BMI160_BMM150 +#define CONFIG_MAG_BMI_BMM150 #define CONFIG_ACCEL_INTERRUPTS #define CONFIG_ACCELGYRO_BMI160_INT_EVENT \ TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL) diff --git a/board/fennel/board.c b/board/fennel/board.c index 401eef5795..0ff79439e2 100644 --- a/board/fennel/board.c +++ b/board/fennel/board.c @@ -15,7 +15,7 @@ #include "common.h" #include "console.h" #include "driver/accel_lis2dw12.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/accelgyro_icm_common.h" #include "driver/accelgyro_icm42607.h" #include "driver/battery/max17055.h" @@ -334,7 +334,7 @@ static const mat33_fp_t lid_standard_ref = { /* sensor private data */ static struct stprivate_data g_lis2dwl_data; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; static struct icm_drv_data_t g_icm42607_data; enum base_accelgyro_type { @@ -436,8 +436,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = SLAVE_MK_SPI_ADDR_FLAGS(CONFIG_SPI_ACCEL_PORT), .rot_standard_ref = &base_standard_ref, .default_range = 2, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -464,8 +464,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = SLAVE_MK_SPI_ADDR_FLAGS(CONFIG_SPI_ACCEL_PORT), .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, }; const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); diff --git a/board/flapjack/board.c b/board/flapjack/board.c index cb191c3578..0825361105 100644 --- a/board/flapjack/board.c +++ b/board/flapjack/board.c @@ -15,7 +15,7 @@ #include "common.h" #include "console.h" #include "cros_board_info.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/als_tcs3400.h" #include "driver/battery/max17055.h" #include "driver/charger/rt946x.h" @@ -452,7 +452,7 @@ void board_config_pre_init(void) #ifdef SECTION_IS_RW static struct mutex g_lid_mutex; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; static struct als_drv_data_t g_tcs3400_data = { .als_cal.scale = 1, @@ -529,8 +529,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .rot_standard_ref = &lid_standard_ref, .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* Enable accel in S0 */ [SENSOR_CONFIG_EC_S0] = { @@ -552,8 +552,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ .rot_standard_ref = &lid_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, [CLEAR_ALS] = { .name = "Clear Light", diff --git a/board/garg/board.c b/board/garg/board.c index 7c997ba546..862f529496 100644 --- a/board/garg/board.c +++ b/board/garg/board.c @@ -14,7 +14,7 @@ #include "common.h" #include "cros_board_info.h" #include "driver/accel_kionix.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/charger/bd9995x.h" #include "driver/ppc/nx20p348x.h" #include "driver/tcpm/anx7447.h" @@ -132,7 +132,7 @@ const mat33_fp_t base_standard_ref = { /* sensor private data */ static struct kionix_accel_data g_kx022_data; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; /* Drivers */ struct motion_sensor_t motion_sensors[] = { @@ -175,8 +175,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .rot_standard_ref = &base_standard_ref, .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -203,8 +203,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, }; diff --git a/board/glados/board.c b/board/glados/board.c index 8003e91906..acd9fdb5ae 100644 --- a/board/glados/board.c +++ b/board/glados/board.c @@ -17,7 +17,7 @@ #include "driver/als_opt3001.h" #include "driver/accel_kionix.h" #include "driver/accel_kx022.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/tcpm/tcpci.h" #include "extpower.h" #include "gpio.h" @@ -440,7 +440,7 @@ static struct mutex g_lid_mutex; static struct mutex g_base_mutex; static struct kionix_accel_data g_kx022_data; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; struct motion_sensor_t motion_sensors[] = { /* @@ -461,8 +461,8 @@ struct motion_sensor_t motion_sensors[] = { .addr = BMI160_ADDR0, .rot_standard_ref = NULL, /* Identity matrix. */ .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -485,8 +485,8 @@ struct motion_sensor_t motion_sensors[] = { .addr = BMI160_ADDR0, .default_range = 1000, /* dps */ .rot_standard_ref = NULL, /* Identity Matrix. */ - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, [LID_ACCEL] = { diff --git a/board/grunt/board.c b/board/grunt/board.c index 85727ca088..1a01a3b3cf 100644 --- a/board/grunt/board.c +++ b/board/grunt/board.c @@ -6,7 +6,7 @@ /* Grunt board-specific configuration */ #include "button.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/led/lm3630a.h" #include "extpower.h" #include "hooks.h" diff --git a/board/hatch/board.c b/board/hatch/board.c index 180dc1be96..98913403ca 100644 --- a/board/hatch/board.c +++ b/board/hatch/board.c @@ -11,7 +11,7 @@ #include "common.h" #include "cros_board_info.h" #include "driver/accel_bma2x2.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/als_tcs3400.h" #include "driver/bc12/pi3usb9201.h" #include "driver/ppc/sn5s330.h" @@ -175,7 +175,7 @@ static struct mutex g_base_mutex; static struct mutex g_lid_mutex; /* Base accel private data */ -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; /* BMA255 private data */ static struct accelgyro_saved_data_t g_bma255_data; @@ -276,8 +276,8 @@ struct motion_sensor_t motion_sensors[] = { .port = I2C_PORT_ACCEL, .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ .config = { [SENSOR_CONFIG_EC_S0] = { @@ -303,8 +303,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, [CLEAR_ALS] = { diff --git a/board/helios/board.c b/board/helios/board.c index 472e19360d..dfede92a2d 100644 --- a/board/helios/board.c +++ b/board/helios/board.c @@ -11,7 +11,7 @@ #include "common.h" #include "cros_board_info.h" #include "driver/accel_bma2x2.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/als_opt3001.h" #include "driver/bc12/pi3usb9201.h" #include "driver/ppc/sn5s330.h" @@ -185,7 +185,7 @@ static struct mutex g_base_mutex; static struct mutex g_lid_mutex; /* Base accel private data */ -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; /* BMA255 private data */ static struct accelgyro_saved_data_t g_bma255_data; @@ -249,8 +249,8 @@ struct motion_sensor_t motion_sensors[] = { .port = I2C_PORT_ACCEL, .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ .config = { [SENSOR_CONFIG_EC_S0] = { @@ -276,8 +276,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, [LID_ALS] = { diff --git a/board/jacuzzi/board.c b/board/jacuzzi/board.c index 0502ed27b3..7c77d8ef3b 100644 --- a/board/jacuzzi/board.c +++ b/board/jacuzzi/board.c @@ -15,7 +15,7 @@ #include "common.h" #include "console.h" #include "driver/accel_kionix.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/accelgyro_icm_common.h" #include "driver/accelgyro_icm426xx.h" #include "driver/battery/max17055.h" @@ -352,7 +352,7 @@ static const mat33_fp_t base_icm426xx_ref = { /* sensor private data */ static struct kionix_accel_data g_kx022_data; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; static struct icm_drv_data_t g_icm426xx_data; enum base_accelgyro_type { @@ -404,8 +404,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = SLAVE_MK_SPI_ADDR_FLAGS(CONFIG_SPI_ACCEL_PORT), .rot_standard_ref = &base_bmi160_ref, .default_range = 2, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -432,8 +432,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = SLAVE_MK_SPI_ADDR_FLAGS(CONFIG_SPI_ACCEL_PORT), .default_range = 1000, /* dps */ .rot_standard_ref = &base_bmi160_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, }; unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); diff --git a/board/kakadu/board.c b/board/kakadu/board.c index 482e84e986..712c4d12e2 100644 --- a/board/kakadu/board.c +++ b/board/kakadu/board.c @@ -14,7 +14,7 @@ #include "chipset.h" #include "common.h" #include "console.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/accelgyro_icm_common.h" #include "driver/accelgyro_icm42607.h" #include "driver/charger/rt946x.h" @@ -295,7 +295,7 @@ DECLARE_HOOK(HOOK_INIT, board_rev_init, HOOK_PRIO_INIT_ADC + 1); #ifndef VARIANT_KUKUI_NO_SENSORS static struct mutex g_lid_mutex; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; static struct icm_drv_data_t g_icm42607_data; enum lid_accelgyro_type { @@ -378,8 +378,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .rot_standard_ref = &lid_standard_ref, .default_range = 4, /* g */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* Enable accel in S0 */ [SENSOR_CONFIG_EC_S0] = { @@ -401,8 +401,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ .rot_standard_ref = &lid_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, [VSYNC] = { .name = "Camera vsync", diff --git a/board/kappa/board.c b/board/kappa/board.c index 460dbeffde..4608769127 100644 --- a/board/kappa/board.c +++ b/board/kappa/board.c @@ -14,7 +14,7 @@ #include "chipset.h" #include "common.h" #include "console.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/battery/max17055.h" #include "driver/bc12/pi3usb9201.h" #include "driver/charger/isl923x.h" diff --git a/board/kindred/board.c b/board/kindred/board.c index 40038cc4b3..ed82d8f837 100644 --- a/board/kindred/board.c +++ b/board/kindred/board.c @@ -11,7 +11,7 @@ #include "common.h" #include "cros_board_info.h" #include "driver/accel_bma2x2.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/bc12/pi3usb9201.h" #include "driver/ppc/sn5s330.h" #include "driver/tcpm/anx7447.h" @@ -177,7 +177,7 @@ static struct mutex g_base_mutex; static struct mutex g_lid_mutex; /* Base accel private data */ -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; /* BMA255 private data */ static struct accelgyro_saved_data_t g_bma255_data; @@ -240,8 +240,8 @@ struct motion_sensor_t motion_sensors[] = { .port = I2C_PORT_ACCEL, .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ .config = { [SENSOR_CONFIG_EC_S0] = { @@ -267,8 +267,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, }; unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); diff --git a/board/kohaku/board.c b/board/kohaku/board.c index d99fd830aa..99521a6e4f 100644 --- a/board/kohaku/board.c +++ b/board/kohaku/board.c @@ -11,7 +11,7 @@ #include "common.h" #include "cros_board_info.h" #include "driver/accel_bma2x2.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/als_bh1730.h" #include "driver/als_tcs3400.h" #include "driver/ppc/sn5s330.h" @@ -163,7 +163,7 @@ static struct mutex g_base_mutex; static struct mutex g_lid_mutex; /* Base accel private data */ -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; /* BMA255 private data */ static struct accelgyro_saved_data_t g_bma255_data; @@ -268,8 +268,8 @@ struct motion_sensor_t motion_sensors[] = { .port = I2C_PORT_ACCEL, .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ .config = { [SENSOR_CONFIG_EC_S0] = { @@ -295,8 +295,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, [BASE_ALS] = { diff --git a/board/kukui/board.c b/board/kukui/board.c index 5ea20a376b..a753ae650d 100644 --- a/board/kukui/board.c +++ b/board/kukui/board.c @@ -14,7 +14,7 @@ #include "chipset.h" #include "common.h" #include "console.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/als_tcs3400.h" #include "driver/bc12/pi3usb9201.h" #include "driver/charger/rt946x.h" @@ -350,7 +350,7 @@ DECLARE_HOOK(HOOK_INIT, board_rev_init, HOOK_PRIO_INIT_ADC + 1); #ifndef VARIANT_KUKUI_NO_SENSORS static struct mutex g_lid_mutex; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; /* TCS3400 private data */ static struct als_drv_data_t g_tcs3400_data = { @@ -421,14 +421,14 @@ static const mat33_fp_t lid_standard_ref = { }; #endif /* BOARD_KUKUI */ -#ifdef CONFIG_MAG_BMI160_BMM150 +#ifdef CONFIG_MAG_BMI_BMM150 /* Matrix to rotate accelrator into standard reference frame */ static const mat33_fp_t mag_standard_ref = { {0, FLOAT_TO_FP(-1), 0}, {FLOAT_TO_FP(-1), 0, 0}, {0, 0, FLOAT_TO_FP(-1)} }; -#endif /* CONFIG_MAG_BMI160_BMM150 */ +#endif /* CONFIG_MAG_BMI_BMM150 */ struct motion_sensor_t motion_sensors[] = { /* @@ -449,8 +449,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .rot_standard_ref = &lid_standard_ref, .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* Enable accel in S0 */ [SENSOR_CONFIG_EC_S0] = { @@ -472,10 +472,10 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ .rot_standard_ref = &lid_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, -#ifdef CONFIG_MAG_BMI160_BMM150 +#ifdef CONFIG_MAG_BMI_BMM150 [LID_MAG] = { .name = "Lid Mag", .active_mask = SENSOR_ACTIVE_S0_S3, @@ -492,7 +492,7 @@ struct motion_sensor_t motion_sensors[] = { .min_frequency = BMM150_MAG_MIN_FREQ, .max_frequency = BMM150_MAG_MAX_FREQ(SPECIAL), }, -#endif /* CONFIG_MAG_BMI160_BMM150 */ +#endif /* CONFIG_MAG_BMI_BMM150 */ [CLEAR_ALS] = { .name = "Clear Light", .active_mask = SENSOR_ACTIVE_S0_S3, diff --git a/board/kukui/board.h b/board/kukui/board.h index 4cc913389a..22d92b68ae 100644 --- a/board/kukui/board.h +++ b/board/kukui/board.h @@ -53,7 +53,7 @@ /* Motion Sensors */ #ifdef SECTION_IS_RW #ifndef BOARD_KRANE -#define CONFIG_MAG_BMI160_BMM150 +#define CONFIG_MAG_BMI_BMM150 #define CONFIG_ACCELGYRO_SEC_ADDR_FLAGS BMM150_ADDR0_FLAGS #define CONFIG_MAG_CALIBRATE #endif /* !BOARD_KRANE */ @@ -121,9 +121,9 @@ enum power_signal { enum sensor_id { LID_ACCEL = 0, LID_GYRO, -#ifdef CONFIG_MAG_BMI160_BMM150 +#ifdef CONFIG_MAG_BMI_BMM150 LID_MAG, -#endif /* CONFIG_MAG_BMI160_BMM150 */ +#endif /* CONFIG_MAG_BMI_BMM150 */ CLEAR_ALS, RGB_ALS, VSYNC, diff --git a/board/makomo/board.c b/board/makomo/board.c index 84575477f5..a7e5c0f516 100644 --- a/board/makomo/board.c +++ b/board/makomo/board.c @@ -15,7 +15,7 @@ #include "common.h" #include "console.h" #include "driver/accel_lis2dw12.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/battery/max17055.h" #include "driver/bc12/pi3usb9201.h" #include "driver/charger/isl923x.h" @@ -329,7 +329,7 @@ static const mat33_fp_t lid_standard_ref = { /* sensor private data */ static struct stprivate_data g_lis2dwl_data; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; struct motion_sensor_t motion_sensors[] = { [LID_ACCEL] = { @@ -376,8 +376,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = SLAVE_MK_SPI_ADDR_FLAGS(CONFIG_SPI_ACCEL_PORT), .rot_standard_ref = &base_standard_ref, .default_range = 2, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -404,8 +404,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = SLAVE_MK_SPI_ADDR_FLAGS(CONFIG_SPI_ACCEL_PORT), .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, }; const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); diff --git a/board/mchpevb1/board.c b/board/mchpevb1/board.c index d6532bd59e..597051a35f 100644 --- a/board/mchpevb1/board.c +++ b/board/mchpevb1/board.c @@ -23,7 +23,7 @@ #include "driver/als_opt3001.h" #include "driver/accel_kionix.h" #include "driver/accel_kx022.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/tcpm/tcpci.h" #include "extpower.h" #include "gpio_chip.h" @@ -907,7 +907,7 @@ DECLARE_HOOK(HOOK_SECOND, board_one_sec, HOOK_PRIO_DEFAULT); static struct mutex g_base_mutex; /* BMI160 private data */ -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; #ifdef CONFIG_ACCEL_KX022 static struct mutex g_lid_mutex; @@ -935,8 +935,8 @@ struct motion_sensor_t motion_sensors[] = { CONFIG_SPI_ACCEL_PORT), .rot_standard_ref = NULL, /* Identity matrix. */ .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -960,8 +960,8 @@ struct motion_sensor_t motion_sensors[] = { CONFIG_SPI_ACCEL_PORT), .default_range = 1000, /* dps */ .rot_standard_ref = NULL, /* Identity Matrix. */ - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, #ifdef CONFIG_ACCEL_KX022 [LID_ACCEL] = { diff --git a/board/munna/board.c b/board/munna/board.c index b2e45adb43..c5ae23300c 100644 --- a/board/munna/board.c +++ b/board/munna/board.c @@ -16,7 +16,7 @@ #include "common.h" #include "console.h" #include "driver/accel_lis2dw12.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/battery/max17055.h" #include "driver/bc12/pi3usb9201.h" #include "driver/charger/isl923x.h" @@ -348,7 +348,7 @@ static const mat33_fp_t lid_standard_ref = { /* sensor private data */ static struct stprivate_data g_lis2dwl_data; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; struct motion_sensor_t motion_sensors[] = { [LID_ACCEL] = { @@ -395,8 +395,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = SLAVE_MK_SPI_ADDR_FLAGS(CONFIG_SPI_ACCEL_PORT), .rot_standard_ref = &base_standard_ref, .default_range = 2, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -423,8 +423,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = SLAVE_MK_SPI_ADDR_FLAGS(CONFIG_SPI_ACCEL_PORT), .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, }; const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); diff --git a/board/nami/board.c b/board/nami/board.c index f9fb3e3b33..9dee38a046 100644 --- a/board/nami/board.c +++ b/board/nami/board.c @@ -19,7 +19,7 @@ #include "console.h" #include "cros_board_info.h" #include "driver/pmic_tps650x30.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/accel_bma2x2.h" #include "driver/accel_kionix.h" #include "driver/baro_bmp280.h" @@ -716,7 +716,7 @@ static struct mutex g_lid_mutex; static struct mutex g_base_mutex; /* Lid accel private data */ -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; static struct kionix_accel_data g_kx022_data; /* BMA255 private data */ @@ -809,8 +809,8 @@ struct motion_sensor_t motion_sensors[] = { .port = I2C_PORT_ACCEL, .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ .config = { /* EC use accel for angle detection */ @@ -838,8 +838,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, }; unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); diff --git a/board/nautilus/board.c b/board/nautilus/board.c index 854d590202..2290b89c52 100644 --- a/board/nautilus/board.c +++ b/board/nautilus/board.c @@ -17,7 +17,7 @@ #include "charger.h" #include "chipset.h" #include "console.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/accel_bma2x2.h" #include "driver/baro_bmp280.h" #include "driver/tcpm/ps8xxx.h" @@ -583,7 +583,7 @@ int board_get_version(void) static struct mutex g_lid_mutex; static struct mutex g_base_mutex; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; /* BMA255 private data */ static struct accelgyro_saved_data_t g_bma255_data; @@ -640,8 +640,8 @@ struct motion_sensor_t motion_sensors[] = { .port = I2C_PORT_ACCEL, .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ .config = { /* EC use accel for angle detection */ @@ -668,8 +668,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, }; const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); diff --git a/board/nocturne/board.c b/board/nocturne/board.c index 5b785e209b..2ba86bed82 100644 --- a/board/nocturne/board.c +++ b/board/nocturne/board.c @@ -14,7 +14,7 @@ #include "common.h" #include "console.h" #include "compile_time_macros.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/als_opt3001.h" #include "driver/ppc/sn5s330.h" #include "driver/sync.h" @@ -165,7 +165,7 @@ const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); static struct mutex g_lid_mutex; /* Sensor driver data */ -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; static struct opt3001_drv_data_t g_opt3001_data = { .scale = 1, .uscale = 0, @@ -193,8 +193,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .rot_standard_ref = &lid_standard_ref, .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* EC setup accel for chrome usage */ [SENSOR_CONFIG_EC_S0] = { @@ -216,8 +216,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .rot_standard_ref = &lid_standard_ref, .default_range = 1000, /* dps */ - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, [LID_ALS] = { diff --git a/board/nucleo-f411re/board.c b/board/nucleo-f411re/board.c index b203ea4884..97f5a8a8d3 100644 --- a/board/nucleo-f411re/board.c +++ b/board/nucleo-f411re/board.c @@ -8,7 +8,7 @@ #include "adc_chip.h" #include "common.h" #include "console.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "ec_version.h" #include "gpio.h" #include "hooks.h" @@ -62,7 +62,7 @@ const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); /* Base Sensor mutex */ static struct mutex g_base_mutex; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; struct motion_sensor_t motion_sensors[] = { [BASE_ACCEL] = { @@ -77,8 +77,8 @@ struct motion_sensor_t motion_sensors[] = { .port = I2C_PORT_ACCEL, .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -105,8 +105,8 @@ struct motion_sensor_t motion_sensors[] = { .port = I2C_PORT_ACCEL, .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, }; const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); diff --git a/board/oak/board.c b/board/oak/board.c index e7b0653907..d27d1aa105 100644 --- a/board/oak/board.c +++ b/board/oak/board.c @@ -18,7 +18,7 @@ #include "console.h" #include "driver/accel_kionix.h" #include "driver/accel_kx022.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/als_opt3001.h" #include "driver/tcpm/tcpci.h" #include "driver/temp_sensor/tmp432.h" @@ -628,7 +628,7 @@ const mat33_fp_t base_standard_ref = { #endif static struct kionix_accel_data g_kx022_data; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; struct motion_sensor_t motion_sensors[] = { #ifdef CONFIG_ACCELGYRO_BMI160 @@ -650,8 +650,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = SLAVE_MK_SPI_ADDR_FLAGS(0), .rot_standard_ref = &base_standard_ref, .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -674,8 +674,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = SLAVE_MK_SPI_ADDR_FLAGS(0), .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, #endif #ifdef CONFIG_ACCEL_KX022 diff --git a/board/poppy/board.c b/board/poppy/board.c index 9faf9575b6..9f2d6c6fbd 100644 --- a/board/poppy/board.c +++ b/board/poppy/board.c @@ -17,7 +17,7 @@ #include "charger.h" #include "chipset.h" #include "console.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/als_opt3001.h" #include "driver/baro_bmp280.h" #include "driver/tcpm/anx74xx.h" @@ -706,7 +706,7 @@ int board_get_version(void) /* Lid Sensor mutex */ static struct mutex g_lid_mutex; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; static struct opt3001_drv_data_t g_opt3001_data = { .scale = 1, .uscale = 0, @@ -755,8 +755,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .rot_standard_ref = &lid_standard_ref, .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -779,8 +779,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ .rot_standard_ref = &lid_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, [LID_MAG] = { diff --git a/board/poppy/board.h b/board/poppy/board.h index 165f0f9e40..c52667f558 100644 --- a/board/poppy/board.h +++ b/board/poppy/board.h @@ -123,7 +123,7 @@ #define CONFIG_MKBP_EVENT #define CONFIG_MKBP_USE_HOST_EVENT #define CONFIG_ACCELGYRO_BMI160 -#define CONFIG_MAG_BMI160_BMM150 +#define CONFIG_MAG_BMI_BMM150 #define CONFIG_ACCEL_INTERRUPTS #define CONFIG_ACCELGYRO_BMI160_INT_EVENT \ TASK_EVENT_MOTION_SENSOR_INTERRUPT(LID_ACCEL) diff --git a/board/rainier/board.c b/board/rainier/board.c index 99751de860..bd3eb37816 100644 --- a/board/rainier/board.c +++ b/board/rainier/board.c @@ -13,7 +13,7 @@ #include "common.h" #include "console.h" #include "ec_commands.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/baro_bmp280.h" #include "driver/tcpm/fusb302.h" #include "driver/temp_sensor/tmp432.h" @@ -350,7 +350,7 @@ int board_get_version(void) /* Mutexes */ static struct mutex g_base_mutex; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; /* Matrix to rotate accelerometer into standard reference frame */ const mat33_fp_t base_standard_ref = { @@ -380,8 +380,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = SLAVE_MK_SPI_ADDR_FLAGS(CONFIG_SPI_ACCEL_PORT), .rot_standard_ref = &base_standard_ref, .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* Enable accel in S0 */ [SENSOR_CONFIG_EC_S0] = { @@ -403,8 +403,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = SLAVE_MK_SPI_ADDR_FLAGS(CONFIG_SPI_ACCEL_PORT), .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, .config = { /* Enable gyro in S0 */ [SENSOR_CONFIG_EC_S0] = { diff --git a/board/rammus/board.c b/board/rammus/board.c index 5782ab4943..3605d74565 100644 --- a/board/rammus/board.c +++ b/board/rammus/board.c @@ -18,7 +18,7 @@ #include "chipset.h" #include "console.h" #include "cros_board_info.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/accel_bma2x2.h" #include "driver/tcpm/ps8xxx.h" #include "driver/tcpm/tcpci.h" @@ -574,7 +574,7 @@ BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT); static struct mutex g_lid_mutex; static struct mutex g_base_mutex; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; /* BMA255 private data */ static struct accelgyro_saved_data_t g_bma255_data; @@ -633,8 +633,8 @@ struct motion_sensor_t motion_sensors[] = { .port = I2C_PORT_ACCEL, .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ .config = { /* EC use accel for angle detection */ @@ -662,8 +662,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, }; const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); diff --git a/board/reef/board.c b/board/reef/board.c index 10516d6e62..7a62d58a87 100644 --- a/board/reef/board.c +++ b/board/reef/board.c @@ -17,7 +17,7 @@ #include "driver/als_opt3001.h" #include "driver/accel_kionix.h" #include "driver/accel_kx022.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/baro_bmp280.h" #include "driver/charger/bd9995x.h" #include "driver/tcpm/anx74xx.h" @@ -695,7 +695,7 @@ const mat33_fp_t mag_standard_ref = { /* sensor private data */ static struct kionix_accel_data g_kx022_data; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; static struct bmp280_drv_data_t bmp280_drv_data; static struct opt3001_drv_data_t g_opt3001_data = { .scale = 1, @@ -745,8 +745,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .rot_standard_ref = &base_standard_ref, .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -774,8 +774,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, [BASE_MAG] = { .name = "Base Mag", diff --git a/board/reef/board.h b/board/reef/board.h index 4d6a65ffcc..59b4054f9a 100644 --- a/board/reef/board.h +++ b/board/reef/board.h @@ -194,7 +194,7 @@ #define CONFIG_ACCEL_INTERRUPTS #define CONFIG_ACCELGYRO_BMI160_INT_EVENT \ TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL) -#define CONFIG_MAG_BMI160_BMM150 +#define CONFIG_MAG_BMI_BMM150 #define CONFIG_ACCELGYRO_SEC_ADDR_FLAGS BMM150_ADDR0_FLAGS #define CONFIG_MAG_CALIBRATE #define CONFIG_ACCEL_KX022 diff --git a/board/reef_mchp/board.c b/board/reef_mchp/board.c index d020d407bc..3301fd48f1 100644 --- a/board/reef_mchp/board.c +++ b/board/reef_mchp/board.c @@ -18,7 +18,7 @@ #include "driver/als_opt3001.h" #include "driver/accel_kionix.h" #include "driver/accel_kx022.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/baro_bmp280.h" #include "driver/charger/bd9995x.h" #include "driver/tcpm/anx74xx.h" @@ -937,7 +937,7 @@ const mat33_fp_t mag_standard_ref = { /* sensor private data */ static struct kionix_accel_data g_kx022_data; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; static struct bmp280_drv_data_t bmp280_drv_data; /* MCHP: struct not present in firmware-reef-9042.B */ static struct opt3001_drv_data_t g_opt3001_data = { @@ -991,8 +991,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .rot_standard_ref = &base_standard_ref, .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -1020,8 +1020,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, [BASE_MAG] = { .name = "Base Mag", diff --git a/board/reef_mchp/board.h b/board/reef_mchp/board.h index acaf8d19be..626b66b2af 100644 --- a/board/reef_mchp/board.h +++ b/board/reef_mchp/board.h @@ -201,7 +201,7 @@ #define CONFIG_ACCEL_INTERRUPTS #define CONFIG_ACCELGYRO_BMI160_INT_EVENT \ TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL) -#define CONFIG_MAG_BMI160_BMM150 +#define CONFIG_MAG_BMI_BMM150 #define CONFIG_ACCELGYRO_SEC_ADDR_FLAGS BMM150_ADDR0_FLAGS #define CONFIG_MAG_CALIBRATE #define CONFIG_ACCEL_KX022 diff --git a/board/scarlet/board.c b/board/scarlet/board.c index aece3503ae..b68864f908 100644 --- a/board/scarlet/board.c +++ b/board/scarlet/board.c @@ -15,7 +15,7 @@ #include "common.h" #include "console.h" #include "ec_commands.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/charger/rt946x.h" #include "driver/sync.h" #include "driver/tcpm/fusb302.h" @@ -376,7 +376,7 @@ int board_get_version(void) /* Mutexes */ static struct mutex g_base_mutex; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; /* Matrix to rotate accelerometer into standard reference frame */ const mat33_fp_t base_standard_ref = { @@ -404,8 +404,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = SLAVE_MK_SPI_ADDR_FLAGS(CONFIG_SPI_ACCEL_PORT), .rot_standard_ref = &base_standard_ref, .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* Enable accel in S0 */ [SENSOR_CONFIG_EC_S0] = { @@ -427,8 +427,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = SLAVE_MK_SPI_ADDR_FLAGS(CONFIG_SPI_ACCEL_PORT), .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, [VSYNC] = { .name = "Camera vsync", diff --git a/board/stern/board.c b/board/stern/board.c index d32cb34ba3..40feac0536 100644 --- a/board/stern/board.c +++ b/board/stern/board.c @@ -15,7 +15,7 @@ #include "common.h" #include "console.h" #include "driver/accel_lis2dw12.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/battery/max17055.h" #include "driver/bc12/pi3usb9201.h" #include "driver/charger/isl923x.h" @@ -332,7 +332,7 @@ static const mat33_fp_t lid_standard_ref = { /* Lid accel private data */ static struct stprivate_data g_lis2dwl_data; /* Base accel private data */ -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; struct motion_sensor_t motion_sensors[] = { [LID_ACCEL] = { @@ -379,8 +379,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = SLAVE_MK_SPI_ADDR_FLAGS(CONFIG_SPI_ACCEL_PORT), .rot_standard_ref = &base_standard_ref, .default_range = 2, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -407,8 +407,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = SLAVE_MK_SPI_ADDR_FLAGS(CONFIG_SPI_ACCEL_PORT), .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, }; const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); diff --git a/board/treeya/board.c b/board/treeya/board.c index 65c825b488..5c93f49253 100644 --- a/board/treeya/board.c +++ b/board/treeya/board.c @@ -7,7 +7,7 @@ #include "button.h" #include "driver/accel_lis2dw12.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/accelgyro_lsm6dsm.h" #include "extpower.h" #include "i2c.h" diff --git a/board/trembyle/board.c b/board/trembyle/board.c index e4e06c70f1..0471411292 100644 --- a/board/trembyle/board.c +++ b/board/trembyle/board.c @@ -6,7 +6,7 @@ /* Trembyle board configuration */ #include "button.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "extpower.h" #include "gpio.h" #include "lid_switch.h" diff --git a/board/willow/board.c b/board/willow/board.c index a162095c22..c3a372f566 100644 --- a/board/willow/board.c +++ b/board/willow/board.c @@ -15,7 +15,7 @@ #include "common.h" #include "console.h" #include "driver/accel_kionix.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accelgyro_bmi_common.h" #include "driver/battery/max17055.h" #include "driver/bc12/pi3usb9201.h" #include "driver/charger/isl923x.h" @@ -321,7 +321,7 @@ static const mat33_fp_t base_standard_ref = { /* sensor private data */ static struct kionix_accel_data g_kx022_data; -static struct bmi160_drv_data_t g_bmi160_data; +static struct bmi_drv_data_t g_bmi160_data; struct motion_sensor_t motion_sensors[] = { [LID_ACCEL] = { @@ -366,8 +366,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = SLAVE_MK_SPI_ADDR_FLAGS(CONFIG_SPI_ACCEL_PORT), .rot_standard_ref = &base_standard_ref, .default_range = 2, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, + .min_frequency = BMI_ACCEL_MIN_FREQ, + .max_frequency = BMI_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -394,8 +394,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = SLAVE_MK_SPI_ADDR_FLAGS(CONFIG_SPI_ACCEL_PORT), .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, - .min_frequency = BMI160_GYRO_MIN_FREQ, - .max_frequency = BMI160_GYRO_MAX_FREQ, + .min_frequency = BMI_GYRO_MIN_FREQ, + .max_frequency = BMI_GYRO_MAX_FREQ, }, }; const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); diff --git a/driver/accelgyro_bmi160.h b/driver/accelgyro_bmi160.h index c1b4b47359..e93d0c28c7 100644 --- a/driver/accelgyro_bmi160.h +++ b/driver/accelgyro_bmi160.h @@ -379,38 +379,8 @@ #define BMI160_FF_DATA_LEN_GYR 6 #define BMI160_FF_DATA_LEN_MAG 8 -/* - * TODO(chingkang): Replace following in some board config to - * bmi version. Then, remove this definition(s). - */ -/* Min and Max sampling frequency in mHz */ -#define BMI160_ACCEL_MIN_FREQ 12500 -#define BMI160_ACCEL_MAX_FREQ MOTION_MAX_SENSOR_FREQUENCY(1600000, 100000) -#define BMI160_GYRO_MIN_FREQ 25000 -#define BMI160_GYRO_MAX_FREQ MOTION_MAX_SENSOR_FREQUENCY(3200000, 100000) - extern const struct accelgyro_drv bmi160_drv; -/* - * TODO(chingkang): Replace bmi160_drv_data_t in some board config to - * bmi_drv_data_t. Then, remove this definition. - */ -struct bmi160_drv_data_t { - struct accelgyro_saved_data_t saved_data[3]; - uint8_t flags; - uint8_t enabled_activities; - uint8_t disabled_activities; -#ifdef CONFIG_MAG_BMI_BMM150 - struct bmm150_private_data compass; -#endif -#ifdef CONFIG_BMI_ORIENTATION_SENSOR - uint8_t raw_orientation; - enum motionsensor_orientation orientation; - enum motionsensor_orientation last_orientation; -#endif - -}; - void bmi160_interrupt(enum gpio_signal signal); #ifdef CONFIG_BMI_SEC_I2C diff --git a/include/config.h b/include/config.h index 627ba43ad1..584d24f6da 100644 --- a/include/config.h +++ b/include/config.h @@ -136,14 +136,12 @@ #undef CONFIG_MAG_BMM150 /* Presence of a Bosh Sensortec BMM150 magnetometer behind a BMIxxx. */ -#undef CONFIG_MAG_BMI160_BMM150 #undef CONFIG_MAG_BMI_BMM150 /* Presence of a Bosh Sensortec BMM150 magnetometer behind a LSM6DSM. */ #undef CONFIG_MAG_LSM6DSM_BMM150 /* Presence of a ST LIS2MDL magnetometer behind a BMIxxx. */ -#undef CONFIG_MAG_BMI160_LIS2MDL #undef CONFIG_MAG_BMI_LIS2MDL /* Presence of a ST LIS2MDL magnetometer behind a LSM6DSM. */ @@ -4441,18 +4439,6 @@ #include "config_chip.h" #include "board.h" -/* - * Define BMI macro when BMI160 is defined - * TODO(chingkang): replace all BMI160 macro by BMI. - */ -#ifdef CONFIG_MAG_BMI160_BMM150 -#define CONFIG_MAG_BMI_BMM150 -#endif - -#ifdef CONFIG_MAG_BMI160_LIS2MDL -#define CONFIG_MAG_BMI_LIS2MDL -#endif - /******************************************************************************/ /* * Automatically define CONFIG_HOSTCMD_X86 if either child option is defined. |