diff options
Diffstat (limited to 'board/mchpevb1/board.c')
-rw-r--r-- | board/mchpevb1/board.c | 112 |
1 files changed, 58 insertions, 54 deletions
diff --git a/board/mchpevb1/board.c b/board/mchpevb1/board.c index 79226d7d71..ed5a661224 100644 --- a/board/mchpevb1/board.c +++ b/board/mchpevb1/board.c @@ -929,64 +929,68 @@ struct motion_sensor_t motion_sensors[] = { * Requirement: accelerometer sensor must init before gyro sensor * DO NOT change the order of the following table. */ - {.name = "Base Accel", - .active_mask = SENSOR_ACTIVE_S0, - .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 = CONFIG_SPI_ACCEL_PORT, - .addr = BMI160_SET_SPI_ADDRESS(CONFIG_SPI_ACCEL_PORT), - .rot_standard_ref = NULL, /* Identity matrix. */ - .default_range = 2, /* g, enough for laptop. */ - .min_frequency = BMI160_ACCEL_MIN_FREQ, - .max_frequency = BMI160_ACCEL_MAX_FREQ, - .config = { - /* EC use accel for angle detection */ - [SENSOR_CONFIG_EC_S0] = { - .odr = 10000 | ROUND_UP_FLAG, - .ec_rate = 100 * MSEC, - }, - }, + [BASE_ACCEL] = { + .name = "Base Accel", + .active_mask = SENSOR_ACTIVE_S0, + .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 = CONFIG_SPI_ACCEL_PORT, + .addr = BMI160_SET_SPI_ADDRESS(CONFIG_SPI_ACCEL_PORT), + .rot_standard_ref = NULL, /* Identity matrix. */ + .default_range = 2, /* g, enough for laptop. */ + .min_frequency = BMI160_ACCEL_MIN_FREQ, + .max_frequency = BMI160_ACCEL_MAX_FREQ, + .config = { + /* EC use accel for angle detection */ + [SENSOR_CONFIG_EC_S0] = { + .odr = 10000 | ROUND_UP_FLAG, + .ec_rate = 100 * MSEC, + }, + }, }, - {.name = "Base Gyro", - .active_mask = SENSOR_ACTIVE_S0, - .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 = CONFIG_SPI_ACCEL_PORT, - .addr = BMI160_SET_SPI_ADDRESS(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, + [BASE_GYRO] = { + .name = "Base Gyro", + .active_mask = SENSOR_ACTIVE_S0, + .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 = CONFIG_SPI_ACCEL_PORT, + .addr = BMI160_SET_SPI_ADDRESS(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, }, #ifdef CONFIG_ACCEL_KX022 - {.name = "Lid Accel", - .active_mask = SENSOR_ACTIVE_S0, - .chip = MOTIONSENSE_CHIP_KX022, - .type = MOTIONSENSE_TYPE_ACCEL, - .location = MOTIONSENSE_LOC_LID, - .drv = &kionix_accel_drv, - .mutex = &g_lid_mutex, - .drv_data = &g_kx022_data, - .port = I2C_PORT_ACCEL, - .addr = KX022_ADDR1, - .rot_standard_ref = NULL, /* Identity matrix. */ - .default_range = 2, /* g, enough for laptop. */ - .min_frequency = KX022_ACCEL_MIN_FREQ, - .max_frequency = KX022_ACCEL_MAX_FREQ, - .config = { - /* EC use accel for angle detection */ - [SENSOR_CONFIG_EC_S0] = { - .odr = 10000 | ROUND_UP_FLAG, - .ec_rate = 100 * MSEC, + [LID_ACCEL] = { + .name = "Lid Accel", + .active_mask = SENSOR_ACTIVE_S0, + .chip = MOTIONSENSE_CHIP_KX022, + .type = MOTIONSENSE_TYPE_ACCEL, + .location = MOTIONSENSE_LOC_LID, + .drv = &kionix_accel_drv, + .mutex = &g_lid_mutex, + .drv_data = &g_kx022_data, + .port = I2C_PORT_ACCEL, + .addr = KX022_ADDR1, + .rot_standard_ref = NULL, /* Identity matrix. */ + .default_range = 2, /* g, enough for laptop. */ + .min_frequency = KX022_ACCEL_MIN_FREQ, + .max_frequency = KX022_ACCEL_MAX_FREQ, + .config = { + /* EC use accel for angle detection */ + [SENSOR_CONFIG_EC_S0] = { + .odr = 10000 | ROUND_UP_FLAG, + .ec_rate = 100 * MSEC, + }, }, }, #endif /* #ifdef CONFIG_ACCEL_KX022 */ |