summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2017-06-11 20:54:53 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-06-13 15:12:35 -0700
commit2cb64480359814aa32cdcaca2c8218b978b53170 (patch)
treeb0c7738a16b3e6e5c5e9f729fcccc1d45055dfa9
parent1cd8daa66495674f8ee09ac40b5568a4f0c6afad (diff)
downloadchrome-ec-2cb64480359814aa32cdcaca2c8218b978b53170.tar.gz
coral: Remove support for magnetometer and barometer sensors
Since Reef was the starting point for /board/coral, coral inherited support for both the BMI150 magnetometer and BMI280 barometer sensors. Coral does not need to support either of these sensors. This CL removes support for both of these sensors. BUG=b:62519010 BRANCH=none TEST=Manual Run 'make BOARD=coral' and verify it builds. Used accelinfo EC console command to verify that other sensor readings are working. My test setup does not have ALS sensor so couldn't confirm that operation. Change-Id: I75abe2f10c8f0ff318f4795e6b88c9aff3d8a9ad Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/530448 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
-rw-r--r--board/coral/board.c78
-rw-r--r--board/coral/board.h8
2 files changed, 2 insertions, 84 deletions
diff --git a/board/coral/board.c b/board/coral/board.c
index 54395246a0..2620770326 100644
--- a/board/coral/board.c
+++ b/board/coral/board.c
@@ -18,7 +18,6 @@
#include "driver/accel_kionix.h"
#include "driver/accel_kx022.h"
#include "driver/accelgyro_bmi160.h"
-#include "driver/baro_bmp280.h"
#include "driver/charger/bd9995x.h"
#include "driver/tcpm/anx74xx.h"
#include "driver/tcpm/ps8751.h"
@@ -210,16 +209,12 @@ struct i2c_stress_test i2c_stress_tests[] = {
/* NPCX_I2C_PORT2 */
#ifdef CONFIG_CMD_I2C_STRESS_TEST_ACCEL
{
- .port = I2C_PORT_BARO,
- .addr = BMP280_I2C_ADDRESS1,
- .i2c_test = &bmp280_i2c_stress_test_dev,
- },
- {
.port = I2C_PORT_LID_ACCEL,
.addr = KX022_ADDR1,
.i2c_test = &kionix_i2c_stress_test_dev,
},
#endif
+
#ifdef CONFIG_CMD_I2C_STRESS_TEST_ALS
{
.port = I2C_PORT_ALS,
@@ -948,77 +943,6 @@ struct motion_sensor_t motion_sensors[] = {
},
},
- [BASE_MAG] = {
- .name = "Base Mag",
- .active_mask = SENSOR_ACTIVE_S0,
- .chip = MOTIONSENSE_CHIP_BMI160,
- .type = MOTIONSENSE_TYPE_MAG,
- .location = MOTIONSENSE_LOC_BASE,
- .drv = &bmi160_drv,
- .mutex = &g_base_mutex,
- .drv_data = &g_bmi160_data,
- .port = I2C_PORT_GYRO,
- .addr = BMI160_ADDR0,
- .default_range = 1 << 11, /* 16LSB / uT, fixed */
- .rot_standard_ref = &mag_standard_ref,
- .config = {
- /* AP: by default shutdown all sensors */
- [SENSOR_CONFIG_AP] = {
- .odr = 0,
- .ec_rate = 0,
- },
- /* EC does not need in S0 */
- [SENSOR_CONFIG_EC_S0] = {
- .odr = 0,
- .ec_rate = 0,
- },
- /* Sensor off in S3/S5 */
- [SENSOR_CONFIG_EC_S3] = {
- .odr = 0,
- .ec_rate = 0,
- },
- /* Sensor off in S3/S5 */
- [SENSOR_CONFIG_EC_S5] = {
- .odr = 0,
- .ec_rate = 0,
- },
- },
- },
-
- [BASE_BARO] = {
- .name = "Base Baro",
- .active_mask = SENSOR_ACTIVE_S0,
- .chip = MOTIONSENSE_CHIP_BMP280,
- .type = MOTIONSENSE_TYPE_BARO,
- .location = MOTIONSENSE_LOC_BASE,
- .drv = &bmp280_drv,
- .drv_data = &bmp280_drv_data,
- .port = I2C_PORT_BARO,
- .addr = BMP280_I2C_ADDRESS1,
- .default_range = 1 << 18, /* 1bit = 4 Pa, 16bit ~= 2600 hPa */
- .config = {
- /* AP: by default shutdown all sensors */
- [SENSOR_CONFIG_AP] = {
- .odr = 0,
- .ec_rate = 0,
- },
- /* EC does not need in S0 */
- [SENSOR_CONFIG_EC_S0] = {
- .odr = 0,
- .ec_rate = 0,
- },
- /* Sensor off in S3/S5 */
- [SENSOR_CONFIG_EC_S3] = {
- .odr = 0,
- .ec_rate = 0,
- },
- /* Sensor off in S3/S5 */
- [SENSOR_CONFIG_EC_S5] = {
- .odr = 0,
- .ec_rate = 0,
- },
- },
- },
[LID_ALS] = {
.name = "Light",
.active_mask = SENSOR_ACTIVE_S0_S3,
diff --git a/board/coral/board.h b/board/coral/board.h
index 45de22ba09..1e60507c12 100644
--- a/board/coral/board.h
+++ b/board/coral/board.h
@@ -186,7 +186,6 @@
#define I2C_PORT_GYRO NPCX_I2C_PORT1
#define I2C_PORT_LID_ACCEL NPCX_I2C_PORT2
#define I2C_PORT_ALS NPCX_I2C_PORT2
-#define I2C_PORT_BARO NPCX_I2C_PORT2
#define I2C_PORT_BATTERY NPCX_I2C_PORT3
#define I2C_PORT_CHARGER NPCX_I2C_PORT3
/* Accelerometer and Gyroscope are the same device. */
@@ -198,12 +197,9 @@
#define CONFIG_ACCELGYRO_BMI160
#define CONFIG_ACCEL_INTERRUPTS
#define CONFIG_ACCELGYRO_BMI160_INT_EVENT TASK_EVENT_CUSTOM(4)
-#define CONFIG_MAG_BMI160_BMM150
-#define BMM150_I2C_ADDRESS BMM150_ADDR0 /* 8-bit address */
#define CONFIG_MAG_CALIBRATE
#define CONFIG_ACCEL_KX022
#define CONFIG_ALS_OPT3001
-#define CONFIG_BARO_BMP280
#define CONFIG_LID_ANGLE
#define CONFIG_LID_ANGLE_UPDATE
#define CONFIG_LID_ANGLE_SENSOR_BASE BASE_ACCEL
@@ -277,8 +273,6 @@ enum sensor_id {
LID_ACCEL = 0,
BASE_ACCEL,
BASE_GYRO,
- BASE_MAG,
- BASE_BARO,
LID_ALS,
};
@@ -330,7 +324,7 @@ void board_set_tcpc_power_mode(int port, int mode);
/* Sensors without hardware FIFO are in forced mode */
#define CONFIG_ACCEL_FORCE_MODE_MASK \
- ((1 << LID_ACCEL) | (1 << BASE_BARO) | (1 << LID_ALS))
+ ((1 << LID_ACCEL) | (1 << LID_ALS))
#endif /* !__ASSEMBLER__ */