diff options
-rw-r--r-- | baseboard/zork/baseboard.c | 91 | ||||
-rw-r--r-- | board/dalboz/board.c | 100 | ||||
-rw-r--r-- | board/dalboz/board.h | 8 | ||||
-rw-r--r-- | board/dalboz/gpio.inc | 2 | ||||
-rw-r--r-- | board/ezkinil/board.c | 93 | ||||
-rw-r--r-- | board/morphius/board.c | 95 | ||||
-rw-r--r-- | board/trembyle/board.c | 94 |
7 files changed, 386 insertions, 97 deletions
diff --git a/baseboard/zork/baseboard.c b/baseboard/zork/baseboard.c index c38429dbc0..d9030fe178 100644 --- a/baseboard/zork/baseboard.c +++ b/baseboard/zork/baseboard.c @@ -15,8 +15,6 @@ #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/bc12/pi3usb9201.h" #include "driver/charger/isl9241.h" @@ -983,95 +981,6 @@ static void setup_fans(void) thermal_params[TEMP_SENSOR_CPU] = thermal_cpu; } -#ifdef HAS_TASK_MOTIONSENSE - -/* Motion sensors */ -static struct mutex g_lid_mutex; -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; - -/* TODO(gcc >= 5.0) Remove the casts to const pointer at rot_standard_ref */ -struct motion_sensor_t motion_sensors[] = { - [LID_ACCEL] = { - .name = "Lid Accel", - .active_mask = SENSOR_ACTIVE_S0_S3, - .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_SENSOR, - .i2c_spi_addr_flags = KX022_ADDR1_FLAGS, - .rot_standard_ref = NULL, - .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, - }, - /* EC use accel for angle detection */ - [SENSOR_CONFIG_EC_S3] = { - .odr = 10000 | ROUND_UP_FLAG, - }, - }, - }, - - [BASE_ACCEL] = { - .name = "Base Accel", - .active_mask = SENSOR_ACTIVE_S0_S3, - .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_SENSOR, - .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, - .config = { - /* EC use accel for angle detection */ - [SENSOR_CONFIG_EC_S0] = { - .odr = 10000 | ROUND_UP_FLAG, - .ec_rate = 100, - }, - /* EC use accel for angle detection */ - [SENSOR_CONFIG_EC_S3] = { - .odr = 10000 | ROUND_UP_FLAG, - }, - }, - }, - - [BASE_GYRO] = { - .name = "Base Gyro", - .active_mask = SENSOR_ACTIVE_S0_S3, - .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_SENSOR, - .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, - }, -}; - -unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); - -#endif /* HAS_TASK_MOTIONSENSE */ #ifndef TEST_BUILD void lid_angle_peripheral_enable(int enable) diff --git a/board/dalboz/board.c b/board/dalboz/board.c index 883f493101..c31cd4cee2 100644 --- a/board/dalboz/board.c +++ b/board/dalboz/board.c @@ -6,7 +6,8 @@ /* Trembyle board configuration */ #include "button.h" -#include "driver/accelgyro_bmi160.h" +#include "driver/accel_lis2dw12.h" +#include "driver/accelgyro_lsm6dsm.h" #include "extpower.h" #include "fan.h" #include "fan_chip.h" @@ -18,10 +19,107 @@ #include "pwm_chip.h" #include "switch.h" #include "system.h" +#include "task.h" #include "usb_charge.h" #include "gpio_list.h" +#ifdef HAS_TASK_MOTIONSENSE + +/* Motion sensors */ +static struct mutex g_lid_mutex; +static struct mutex g_base_mutex; + +/* sensor private data */ +static struct stprivate_data g_lis2dwl_data; +static struct lsm6dsm_data g_lsm6dsm_data = LSM6DSM_DATA; + +/* TODO(gcc >= 5.0) Remove the casts to const pointer at rot_standard_ref */ +struct motion_sensor_t motion_sensors[] = { + [LID_ACCEL] = { + .name = "Lid Accel", + .active_mask = SENSOR_ACTIVE_S0_S3, + .chip = MOTIONSENSE_CHIP_LIS2DWL, + .type = MOTIONSENSE_TYPE_ACCEL, + .location = MOTIONSENSE_LOC_LID, + .drv = &lis2dw12_drv, + .mutex = &g_lid_mutex, + .drv_data = &g_lis2dwl_data, + .port = I2C_PORT_SENSOR, + .i2c_spi_addr_flags = LIS2DWL_ADDR1_FLAGS, + .rot_standard_ref = NULL, + .default_range = 2, /* g, enough for laptop. */ + .min_frequency = LIS2DW12_ODR_MIN_VAL, + .max_frequency = LIS2DW12_ODR_MAX_VAL, + .config = { + /* EC use accel for angle detection */ + [SENSOR_CONFIG_EC_S0] = { + .odr = 12500 | ROUND_UP_FLAG, + }, + /* Sensor on for lid angle detection */ + [SENSOR_CONFIG_EC_S3] = { + .odr = 10000 | ROUND_UP_FLAG, + }, + }, + }, + + [BASE_ACCEL] = { + .name = "Base Accel", + .active_mask = SENSOR_ACTIVE_S0_S3, + .chip = MOTIONSENSE_CHIP_LSM6DSM, + .type = MOTIONSENSE_TYPE_ACCEL, + .location = MOTIONSENSE_LOC_BASE, + .drv = &lsm6dsm_drv, + .mutex = &g_base_mutex, + .drv_data = LSM6DSM_ST_DATA(g_lsm6dsm_data, + MOTIONSENSE_TYPE_ACCEL), + .int_signal = GPIO_6AXIS_INT_L, + .flags = MOTIONSENSE_FLAG_INT_SIGNAL, + .port = I2C_PORT_SENSOR, + .i2c_spi_addr_flags = LSM6DSM_ADDR0_FLAGS, + .default_range = 4, /* g, enough for laptop */ + .rot_standard_ref = NULL, + .min_frequency = LSM6DSM_ODR_MIN_VAL, + .max_frequency = LSM6DSM_ODR_MAX_VAL, + .config = { + /* EC use accel for angle detection */ + [SENSOR_CONFIG_EC_S0] = { + .odr = 13000 | ROUND_UP_FLAG, + .ec_rate = 100 * MSEC, + }, + /* Sensor on for angle detection */ + [SENSOR_CONFIG_EC_S3] = { + .odr = 10000 | ROUND_UP_FLAG, + .ec_rate = 100 * MSEC, + }, + }, + }, + + [BASE_GYRO] = { + .name = "Base Gyro", + .active_mask = SENSOR_ACTIVE_S0_S3, + .chip = MOTIONSENSE_CHIP_LSM6DSM, + .type = MOTIONSENSE_TYPE_GYRO, + .location = MOTIONSENSE_LOC_BASE, + .drv = &lsm6dsm_drv, + .mutex = &g_base_mutex, + .drv_data = LSM6DSM_ST_DATA(g_lsm6dsm_data, + MOTIONSENSE_TYPE_GYRO), + .int_signal = GPIO_6AXIS_INT_L, + .flags = MOTIONSENSE_FLAG_INT_SIGNAL, + .port = I2C_PORT_SENSOR, + .i2c_spi_addr_flags = LSM6DSM_ADDR0_FLAGS, + .default_range = 1000 | ROUND_UP_FLAG, /* dps */ + .rot_standard_ref = NULL, + .min_frequency = LSM6DSM_ODR_MIN_VAL, + .max_frequency = LSM6DSM_ODR_MAX_VAL, + }, +}; + +unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); + +#endif /* HAS_TASK_MOTIONSENSE */ + /* These GPIOs moved. Temporarily detect and support the V0 HW. */ enum gpio_signal GPIO_PCH_PWRBTN_L = GPIO_EC_FCH_PWR_BTN_L; enum gpio_signal GPIO_PCH_SYS_PWROK = GPIO_EC_FCH_PWROK; diff --git a/board/dalboz/board.h b/board/dalboz/board.h index 5b6fc18e3f..a8ff57c13e 100644 --- a/board/dalboz/board.h +++ b/board/dalboz/board.h @@ -21,11 +21,11 @@ #define CONFIG_MKBP_USE_GPIO /* Motion sensing drivers */ -#define CONFIG_ACCELGYRO_BMI160 -#define CONFIG_ACCELGYRO_BMI160_INT_EVENT \ +#define CONFIG_ACCELGYRO_LSM6DSM +#define CONFIG_ACCEL_LSM6DSM_INT_EVENT \ TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL) +#define CONFIG_ACCEL_LIS2DWL #define CONFIG_ACCEL_INTERRUPTS -#define CONFIG_ACCEL_KX022 #define CONFIG_CMD_ACCELS #define CONFIG_CMD_ACCEL_INFO #define CONFIG_TABLET_MODE @@ -34,6 +34,8 @@ #define CONFIG_LID_ANGLE_SENSOR_BASE BASE_ACCEL #define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL + + /* GPIO mapping from board specific name to EC common name. */ #define CONFIG_BATTERY_PRESENT_GPIO GPIO_EC_BATT_PRES_ODL #define GPIO_AC_PRESENT GPIO_ACOK_OD diff --git a/board/dalboz/gpio.inc b/board/dalboz/gpio.inc index c29a44f901..5b55cd7125 100644 --- a/board/dalboz/gpio.inc +++ b/board/dalboz/gpio.inc @@ -24,7 +24,7 @@ GPIO_INT(ACOK_OD, PIN(0, 0), GPIO_INT_BOTH | GPIO_HIB_WAKE_HIGH, extpower_inter GPIO_INT(EC_WP_L, PIN(5, 0), GPIO_INT_BOTH, switch_interrupt) GPIO_INT(VOLDN_BTN_ODL, PIN(A, 6), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt) GPIO_INT(VOLUP_BTN_ODL, PIN(9, 5), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt) -GPIO_INT(6AXIS_INT_L, PIN(A, 0), GPIO_INT_FALLING | GPIO_PULL_UP, bmi160_interrupt) +GPIO_INT(6AXIS_INT_L, PIN(A, 0), GPIO_INT_FALLING | GPIO_PULL_UP, lsm6dsm_interrupt) /* GPIO_INT_BOTH is required for PSL wake from hibernate, but we don't need an interrupt handler. */ GPIO(EC_RST_ODL, PIN(0, 2), GPIO_INT_BOTH | GPIO_HIB_WAKE_HIGH) diff --git a/board/ezkinil/board.c b/board/ezkinil/board.c index a177b5bc1f..08ec79df5a 100644 --- a/board/ezkinil/board.c +++ b/board/ezkinil/board.c @@ -7,6 +7,8 @@ #include "button.h" #include "driver/accelgyro_bmi160.h" +#include "driver/accel_kionix.h" +#include "driver/accel_kx022.h" #include "extpower.h" #include "fan.h" #include "fan_chip.h" @@ -18,10 +20,101 @@ #include "pwm_chip.h" #include "switch.h" #include "system.h" +#include "task.h" #include "usb_charge.h" #include "gpio_list.h" +#ifdef HAS_TASK_MOTIONSENSE + +/* Motion sensors */ +static struct mutex g_lid_mutex; +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; + +/* TODO(gcc >= 5.0) Remove the casts to const pointer at rot_standard_ref */ +struct motion_sensor_t motion_sensors[] = { + [LID_ACCEL] = { + .name = "Lid Accel", + .active_mask = SENSOR_ACTIVE_S0_S3, + .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_SENSOR, + .i2c_spi_addr_flags = KX022_ADDR1_FLAGS, + .rot_standard_ref = NULL, + .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, + }, + /* EC use accel for angle detection */ + [SENSOR_CONFIG_EC_S3] = { + .odr = 10000 | ROUND_UP_FLAG, + }, + }, + }, + + [BASE_ACCEL] = { + .name = "Base Accel", + .active_mask = SENSOR_ACTIVE_S0_S3, + .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_SENSOR, + .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, + .config = { + /* EC use accel for angle detection */ + [SENSOR_CONFIG_EC_S0] = { + .odr = 10000 | ROUND_UP_FLAG, + .ec_rate = 100, + }, + /* EC use accel for angle detection */ + [SENSOR_CONFIG_EC_S3] = { + .odr = 10000 | ROUND_UP_FLAG, + }, + }, + }, + + [BASE_GYRO] = { + .name = "Base Gyro", + .active_mask = SENSOR_ACTIVE_S0_S3, + .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_SENSOR, + .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, + }, +}; + +unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); + +#endif /* HAS_TASK_MOTIONSENSE */ + /* These GPIOs moved. Temporarily detect and support the V0 HW. */ enum gpio_signal GPIO_PCH_PWRBTN_L = GPIO_EC_FCH_PWR_BTN_L; enum gpio_signal GPIO_PCH_SYS_PWROK = GPIO_EC_FCH_PWROK; diff --git a/board/morphius/board.c b/board/morphius/board.c index 0f8add5d1a..5eb913f22a 100644 --- a/board/morphius/board.c +++ b/board/morphius/board.c @@ -7,6 +7,8 @@ #include "button.h" #include "driver/accelgyro_bmi160.h" +#include "driver/accel_kionix.h" +#include "driver/accel_kx022.h" #include "extpower.h" #include "gpio.h" #include "fan.h" @@ -19,10 +21,103 @@ #include "pwm_chip.h" #include "switch.h" #include "system.h" +#include "task.h" #include "usb_charge.h" #include "gpio_list.h" + + +#ifdef HAS_TASK_MOTIONSENSE + +/* Motion sensors */ +static struct mutex g_lid_mutex; +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; + +/* TODO(gcc >= 5.0) Remove the casts to const pointer at rot_standard_ref */ +struct motion_sensor_t motion_sensors[] = { + [LID_ACCEL] = { + .name = "Lid Accel", + .active_mask = SENSOR_ACTIVE_S0_S3, + .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_SENSOR, + .i2c_spi_addr_flags = KX022_ADDR1_FLAGS, + .rot_standard_ref = NULL, + .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, + }, + /* EC use accel for angle detection */ + [SENSOR_CONFIG_EC_S3] = { + .odr = 10000 | ROUND_UP_FLAG, + }, + }, + }, + + [BASE_ACCEL] = { + .name = "Base Accel", + .active_mask = SENSOR_ACTIVE_S0_S3, + .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_SENSOR, + .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, + .config = { + /* EC use accel for angle detection */ + [SENSOR_CONFIG_EC_S0] = { + .odr = 10000 | ROUND_UP_FLAG, + .ec_rate = 100, + }, + /* EC use accel for angle detection */ + [SENSOR_CONFIG_EC_S3] = { + .odr = 10000 | ROUND_UP_FLAG, + }, + }, + }, + + [BASE_GYRO] = { + .name = "Base Gyro", + .active_mask = SENSOR_ACTIVE_S0_S3, + .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_SENSOR, + .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, + }, +}; + +unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); + +#endif /* HAS_TASK_MOTIONSENSE */ + /* These GPIOs moved. Temporarily detect and support the V0 HW. */ enum gpio_signal GPIO_PCH_PWRBTN_L = GPIO_EC_FCH_PWR_BTN_L; enum gpio_signal GPIO_PCH_SYS_PWROK = GPIO_EC_FCH_PWROK; diff --git a/board/trembyle/board.c b/board/trembyle/board.c index 883f493101..77214eac86 100644 --- a/board/trembyle/board.c +++ b/board/trembyle/board.c @@ -7,6 +7,8 @@ #include "button.h" #include "driver/accelgyro_bmi160.h" +#include "driver/accel_kionix.h" +#include "driver/accel_kx022.h" #include "extpower.h" #include "fan.h" #include "fan_chip.h" @@ -18,10 +20,100 @@ #include "pwm_chip.h" #include "switch.h" #include "system.h" +#include "task.h" #include "usb_charge.h" - #include "gpio_list.h" +#ifdef HAS_TASK_MOTIONSENSE + +/* Motion sensors */ +static struct mutex g_lid_mutex; +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; + +/* TODO(gcc >= 5.0) Remove the casts to const pointer at rot_standard_ref */ +struct motion_sensor_t motion_sensors[] = { + [LID_ACCEL] = { + .name = "Lid Accel", + .active_mask = SENSOR_ACTIVE_S0_S3, + .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_SENSOR, + .i2c_spi_addr_flags = KX022_ADDR1_FLAGS, + .rot_standard_ref = NULL, + .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, + }, + /* EC use accel for angle detection */ + [SENSOR_CONFIG_EC_S3] = { + .odr = 10000 | ROUND_UP_FLAG, + }, + }, + }, + + [BASE_ACCEL] = { + .name = "Base Accel", + .active_mask = SENSOR_ACTIVE_S0_S3, + .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_SENSOR, + .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, + .config = { + /* EC use accel for angle detection */ + [SENSOR_CONFIG_EC_S0] = { + .odr = 10000 | ROUND_UP_FLAG, + .ec_rate = 100, + }, + /* EC use accel for angle detection */ + [SENSOR_CONFIG_EC_S3] = { + .odr = 10000 | ROUND_UP_FLAG, + }, + }, + }, + + [BASE_GYRO] = { + .name = "Base Gyro", + .active_mask = SENSOR_ACTIVE_S0_S3, + .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_SENSOR, + .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, + }, +}; + +unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); + +#endif /* HAS_TASK_MOTIONSENSE */ + /* These GPIOs moved. Temporarily detect and support the V0 HW. */ enum gpio_signal GPIO_PCH_PWRBTN_L = GPIO_EC_FCH_PWR_BTN_L; enum gpio_signal GPIO_PCH_SYS_PWROK = GPIO_EC_FCH_PWROK; |