diff options
-rw-r--r-- | board/elm/board.c | 14 | ||||
-rw-r--r-- | board/elm/board.h | 19 |
2 files changed, 25 insertions, 8 deletions
diff --git a/board/elm/board.c b/board/elm/board.c index 5328c7dbba..678b25df38 100644 --- a/board/elm/board.c +++ b/board/elm/board.c @@ -546,7 +546,8 @@ const matrix_3x3_t lid_standard_ref = { struct kionix_accel_data g_kx022_data[2]; struct motion_sensor_t motion_sensors[] = { - {.name = "Base Accel", + [BASE_ACCEL] = { + .name = "Base Accel", .active_mask = SENSOR_ACTIVE_S0, .chip = MOTIONSENSE_CHIP_KX022, .type = MOTIONSENSE_TYPE_ACCEL, @@ -560,8 +561,8 @@ struct motion_sensor_t motion_sensors[] = { .config = { /* AP: by default use EC settings */ [SENSOR_CONFIG_AP] = { - .odr = 10000 | ROUND_UP_FLAG, - .ec_rate = 100 * MSEC, + .odr = 0, + .ec_rate = 0, }, /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -580,7 +581,8 @@ struct motion_sensor_t motion_sensors[] = { }, }, - {.name = "Lid Accel", + [LID_ACCEL] = { + .name = "Lid Accel", .active_mask = SENSOR_ACTIVE_S0, .chip = MOTIONSENSE_CHIP_KX022, .type = MOTIONSENSE_TYPE_ACCEL, @@ -594,8 +596,8 @@ struct motion_sensor_t motion_sensors[] = { .config = { /* AP: by default use EC settings */ [SENSOR_CONFIG_AP] = { - .odr = 10000 | ROUND_UP_FLAG, - .ec_rate = 100 * MSEC, + .odr = 0, + .ec_rate = 0, }, /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { diff --git a/board/elm/board.h b/board/elm/board.h index 7d109a1120..8f294d5dc0 100644 --- a/board/elm/board.h +++ b/board/elm/board.h @@ -15,9 +15,18 @@ #define CONFIG_CMD_ACCEL_INFO #define CONFIG_CMD_ACCEL_RESET #define CONFIG_LID_ANGLE -#define CONFIG_LID_ANGLE_SENSOR_BASE 0 -#define CONFIG_LID_ANGLE_SENSOR_LID 1 +#define CONFIG_LID_ANGLE_SENSOR_BASE BASE_ACCEL +#define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL #define CONFIG_LID_ANGLE_UPDATE +/* FIFO size is in power of 2. */ +#define CONFIG_ACCEL_FIFO 512 +#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO / 3) + +/* + * Sensor internal FIFO is enabled for BMI160, but not for BMA255. + */ +#define CONFIG_ACCEL_FORCE_MODE_MASK \ + ((1 << LID_ACCEL) | (1 << BASE_ACCEL)) #define CONFIG_ADC #undef CONFIG_ADC_WATCHDOG @@ -189,6 +198,12 @@ enum temp_sensor_id { TEMP_SENSOR_COUNT }; +/* Motion sensors */ +enum sensor_id { + BASE_ACCEL = 0, + LID_ACCEL, +}; + /* start as a sink in case we have no other power supply/battery */ #define PD_DEFAULT_STATE PD_STATE_SNK_DISCONNECTED |