summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2019-04-24 14:38:38 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-05-09 16:05:58 -0700
commitd600316362ef86d893d0f65db73e962184d8c3ce (patch)
tree35f09c6f4ecd59508561628d486663e6d9cf220b
parent1fcab2af05730a3ca938dd651fd9fc9bdc62ab62 (diff)
downloadchrome-ec-d600316362ef86d893d0f65db73e962184d8c3ce.tar.gz
board: atlas: Remove BMI160 support
Atlas may ship without IMU. hardware_features.xml indicates no IMU support (CL:*1168651 and CL:*1138132) Prevent EC to report IMU even if present. BUG=b:129078548 TEST=Compile BRANCH=atlas Change-Id: I600ef7268d7cea50164bf2e9fe7dd54d00329437 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1582609 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Caveh Jalali <caveh@google.com> Reviewed-by: Bob Moragues <moragues@chromium.org> Reviewed-by: Caveh Jalali <caveh@google.com>
-rw-r--r--board/atlas/board.c42
-rw-r--r--board/atlas/board.h7
-rw-r--r--board/atlas/gpio.inc2
3 files changed, 1 insertions, 50 deletions
diff --git a/board/atlas/board.c b/board/atlas/board.c
index df72cedcbf..618838714c 100644
--- a/board/atlas/board.c
+++ b/board/atlas/board.c
@@ -162,8 +162,6 @@ const struct i2c_port_t i2c_ports[] = {
GPIO_EC_I2C3_SENSOR_3V3_SCL, GPIO_EC_I2C3_SENSOR_3V3_SDA},
{"battery", I2C_PORT_BATTERY, 100,
GPIO_EC_I2C4_BATTERY_SCL, GPIO_EC_I2C4_BATTERY_SDA},
- {"gyro", I2C_PORT_GYRO, 100,
- GPIO_EC_I2C5_GYRO_SCL, GPIO_EC_I2C5_GYRO_SDA},
};
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
@@ -256,7 +254,6 @@ const struct temp_sensor_t temp_sensors[] = {
BD99992GW_ADC_CHANNEL_SYSTHERM2, 4},
{"eMMC", TEMP_SENSOR_TYPE_BOARD, bd99992gw_get_val,
BD99992GW_ADC_CHANNEL_SYSTHERM3, 4},
- {"gyro", TEMP_SENSOR_TYPE_BOARD, bmi160_get_sensor_temp, BASE_GYRO, 1},
};
BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
@@ -471,9 +468,6 @@ static void board_init(void)
/* Provide AC status to the PCH */
gpio_set_level(GPIO_PCH_ACOK, extpower_is_present());
-
- /* Enable interrupts from BMI160 sensor. */
- gpio_enable_interrupt(GPIO_ACCELGYRO3_INT_L);
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
@@ -583,10 +577,6 @@ int board_get_version(void)
return ver;
}
-/* Base Sensor mutex */
-static struct mutex g_base_mutex;
-
-static struct bmi160_drv_data_t g_bmi160_data;
static struct opt3001_drv_data_t g_opt3001_data = {
.scale = 1,
.uscale = 0,
@@ -601,38 +591,6 @@ const mat33_fp_t base_standard_ref = {
};
struct motion_sensor_t motion_sensors[] = {
- [BASE_ACCEL] = {
- .name = "Base Accel",
- .active_mask = SENSOR_ACTIVE_S0_S3_S5,
- .chip = MOTIONSENSE_CHIP_BMI160,
- .type = MOTIONSENSE_TYPE_ACCEL,
- .location = MOTIONSENSE_LOC_BASE,
- .drv = &bmi160_drv,
- .mutex = &g_base_mutex,
- .drv_data = &g_bmi160_data,
- .port = I2C_PORT_GYRO,
- .addr = BMI160_ADDR0,
- .rot_standard_ref = &base_standard_ref,
- .default_range = 2, /* g, enough for laptop. */
- .min_frequency = BMI160_ACCEL_MIN_FREQ,
- .max_frequency = BMI160_ACCEL_MAX_FREQ,
- },
- [BASE_GYRO] = {
- .name = "Base Gyro",
- .active_mask = SENSOR_ACTIVE_S0_S3_S5,
- .chip = MOTIONSENSE_CHIP_BMI160,
- .type = MOTIONSENSE_TYPE_GYRO,
- .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 = 1000, /* dps */
- .rot_standard_ref = &base_standard_ref,
- .min_frequency = BMI160_GYRO_MIN_FREQ,
- .max_frequency = BMI160_GYRO_MAX_FREQ,
- },
[LID_ALS] = {
.name = "Light",
.active_mask = SENSOR_ACTIVE_S0,
diff --git a/board/atlas/board.h b/board/atlas/board.h
index 3475bae97b..636ff2c982 100644
--- a/board/atlas/board.h
+++ b/board/atlas/board.h
@@ -117,10 +117,6 @@
#define CONFIG_ACCEL_FIFO 1024
#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO / 3)
#define CONFIG_ACCEL_INTERRUPTS
-#define CONFIG_ACCELGYRO_BMI160
-#define CONFIG_ACCELGYRO_BMI160_INT_EVENT \
- TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL)
-#undef CONFIG_SENSOR_TIGHT_TIMESTAMPS
/* USB */
#define CONFIG_USB_PD_ALT_MODE
@@ -195,7 +191,6 @@ enum temp_sensor_id {
TEMP_SENSOR_SYSTHERM1, /* BD99992GW SYSTHERM1 */
TEMP_SENSOR_SYSTHERM2, /* BD99992GW SYSTHERM2 */
TEMP_SENSOR_SYSTHERM3, /* BD99992GW SYSTHERM3 */
- TEMP_SENSOR_GYRO,
TEMP_SENSOR_COUNT
};
@@ -211,8 +206,6 @@ enum pwm_channel {
};
enum sensor_id {
- BASE_ACCEL,
- BASE_GYRO,
LID_ALS,
};
diff --git a/board/atlas/gpio.inc b/board/atlas/gpio.inc
index 043e7e4506..4ce44cc130 100644
--- a/board/atlas/gpio.inc
+++ b/board/atlas/gpio.inc
@@ -23,7 +23,6 @@ GPIO_INT(ROP_EC_ACOK, PIN(0, 0), GPIO_INT_BOTH | GPIO_HIB_WAKE_HIGH, extpower_i
/* misc interrupt handler section */
GPIO_INT(EC_WP_L, PIN(A, 1), GPIO_INT_BOTH, switch_interrupt)
GPIO_INT(LID_OPEN, PIN(D, 2), GPIO_INT_BOTH | GPIO_HIB_WAKE_HIGH, lid_interrupt)
-GPIO_INT(ACCELGYRO3_INT_L, PIN(4, 1), GPIO_INT_FALLING, bmi160_interrupt)
/* SoC section */
GPIO(RSMRST_L, PIN(3, 7), GPIO_OUT_LOW) /* SOC Resume Reset */
@@ -103,6 +102,7 @@ GPIO(NC_GPIOC7, PIN(C, 7), GPIO_INPUT | GPIO_PULL_UP)
GPIO(NC_GPIOD6, PIN(D, 6), GPIO_INPUT | GPIO_PULL_UP)
GPIO(NC_GPIOD7, PIN(D, 7), GPIO_INPUT | GPIO_PULL_UP)
GPIO(NC_GPIOE0, PIN(E, 0), GPIO_INPUT | GPIO_PULL_UP)
+GPIO(ACCELGYRO3_INT_L, PIN(4, 1), GPIO_INPUT | GPIO_PULL_UP)
/* WoV is unused */
GPIO(NC_GPIO94, PIN(9, 4), GPIO_INPUT | GPIO_PULL_UP)