summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2019-04-24 14:38:38 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2019-05-09 02:13:10 +0000
commit040b4e683ed4368eb42029ff7275efd65bf9366a (patch)
treea5db6948cdf7c0a2bfac65e11db0089102f166f0
parentc098055c4c275eb31264aa1b1adc1983b90f0551 (diff)
downloadchrome-ec-040b4e683ed4368eb42029ff7275efd65bf9366a.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/c/chromiumos/platform/ec/+/1601879 Reviewed-by: Caveh Jalali <caveh@google.com> Commit-Queue: Caveh Jalali <caveh@google.com> Tested-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 2ae9787897..97ba9f8940 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);
@@ -254,7 +252,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);
@@ -469,9 +466,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);
@@ -581,10 +575,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,
@@ -599,38 +589,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 2122e8367d..db2beac5f5 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)