summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/kevin/board.c28
-rw-r--r--board/kevin/board.h10
2 files changed, 25 insertions, 13 deletions
diff --git a/board/kevin/board.c b/board/kevin/board.c
index a152ea94b5..dfcfc6aa97 100644
--- a/board/kevin/board.c
+++ b/board/kevin/board.c
@@ -448,7 +448,8 @@ 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",
+ [BASE_ACCEL] = {
+ .name = "Base Accel",
.active_mask = SENSOR_ACTIVE_S0,
.chip = MOTIONSENSE_CHIP_BMI160,
.type = MOTIONSENSE_TYPE_ACCEL,
@@ -469,7 +470,7 @@ struct motion_sensor_t motion_sensors[] = {
/* EC use accel for angle detection */
[SENSOR_CONFIG_EC_S0] = {
.odr = 10000 | ROUND_UP_FLAG,
- .ec_rate = 100,
+ .ec_rate = 0,
},
/* Sensor off in S3/S5 */
[SENSOR_CONFIG_EC_S3] = {
@@ -483,8 +484,8 @@ struct motion_sensor_t motion_sensors[] = {
},
},
},
-
- {.name = "Base Gyro",
+ [BASE_GYRO] = {
+ .name = "Base Gyro",
.active_mask = SENSOR_ACTIVE_S0,
.chip = MOTIONSENSE_CHIP_BMI160,
.type = MOTIONSENSE_TYPE_GYRO,
@@ -523,9 +524,9 @@ struct motion_sensor_t motion_sensors[] = {
},
},
},
-
#ifdef BOARD_KEVIN
- {.name = "Lid Accel",
+ [LID_ACCEL] = {
+ .name = "Lid Accel",
.active_mask = SENSOR_ACTIVE_S0,
.chip = MOTIONSENSE_CHIP_BMA255,
.type = MOTIONSENSE_TYPE_ACCEL,
@@ -540,13 +541,13 @@ 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] = {
.odr = 10000 | ROUND_UP_FLAG,
- .ec_rate = 100 * MSEC,
+ .ec_rate = 0,
},
/* unused */
[SENSOR_CONFIG_EC_S3] = {
@@ -560,7 +561,8 @@ struct motion_sensor_t motion_sensors[] = {
},
},
#else
- {.name = "Lid Accel",
+ [LID_ACCEL] = {
+ .name = "Lid Accel",
.active_mask = SENSOR_ACTIVE_S0,
.chip = MOTIONSENSE_CHIP_KX022,
.type = MOTIONSENSE_TYPE_ACCEL,
@@ -575,13 +577,13 @@ 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] = {
.odr = 10000 | ROUND_UP_FLAG,
- .ec_rate = 100 * MSEC,
+ .ec_rate = 0,
},
/* unused */
[SENSOR_CONFIG_EC_S3] = {
diff --git a/board/kevin/board.h b/board/kevin/board.h
index a39ffa03f1..76464c22ef 100644
--- a/board/kevin/board.h
+++ b/board/kevin/board.h
@@ -80,6 +80,16 @@
#define CONFIG_LID_ANGLE
#define CONFIG_LID_ANGLE_SENSOR_BASE BASE_ACCEL
#define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL
+/* FIFO size is in power of 2. */
+#define CONFIG_ACCEL_FIFO 256
+#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO / 3)
+
+/*
+ * Sensor internal FIFO are not enabled, we need to poll at
+ * every data point.
+ */
+#define CONFIG_ACCEL_FORCE_MODE_MASK \
+ ((1 << BASE_ACCEL) | (1 << BASE_GYRO) | (1 << LID_ACCEL))
/* USB PD config */
#define CONFIG_CASE_CLOSED_DEBUG_EXTERNAL