summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2021-09-17 23:15:44 -0700
committerCommit Bot <commit-bot@chromium.org>2021-09-23 02:17:50 +0000
commit7537986533dec6db5d903dde935a566f14b6035a (patch)
tree8e9f620b36e889eb6d7bf4f78efa69580ad0dea8
parent584a379e741fa03875422045fab4bf730acccd9e (diff)
downloadchrome-ec-7537986533dec6db5d903dde935a566f14b6035a.tar.gz
board: Do not enable gyroscope by default
Enable gyroscope only when the AP needs it. It is not used by the EC. For lid calculation, set frequency at 10HZ, the drivers will calculate higher frequencies when needed. Modify other boards as well: Use awk '/\.type = MOTIONSENSE_TYPE_GYRO,/ { check_config=1 } \ /\.config = / { if (check_config) { print FILENAME,$0 } } \ /\.type = MOTIONSENSE_TYPE_[^G]/ { check_config=0 }' board/*/sensors.c | \ cut -d ' ' -f 1' to locate the impacted files (board.c as well). BUG=none BRANCH=none TEST=Check rotation is still working on brya Change-Id: I45d82d00c30e35541df80d1b7805f8302b3d98ff Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3170174 Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r--board/brya/sensors.c12
-rw-r--r--board/felwinter/sensors.c10
-rw-r--r--board/kano/sensors.c10
-rw-r--r--board/rainier/board.c7
-rw-r--r--board/redrix/sensors.c10
-rw-r--r--board/taeko/sensors.c10
-rw-r--r--board/voema/sensors.c2
7 files changed, 1 insertions, 60 deletions
diff --git a/board/brya/sensors.c b/board/brya/sensors.c
index efe65f4f53..57d70471ba 100644
--- a/board/brya/sensors.c
+++ b/board/brya/sensors.c
@@ -142,7 +142,7 @@ struct motion_sensor_t motion_sensors[] = {
.config = {
/* EC use accel for angle detection */
[SENSOR_CONFIG_EC_S0] = {
- .odr = 12500 | ROUND_UP_FLAG,
+ .odr = 10000 | ROUND_UP_FLAG,
},
/* Sensor on for lid angle detection */
[SENSOR_CONFIG_EC_S3] = {
@@ -199,16 +199,6 @@ struct motion_sensor_t motion_sensors[] = {
.rot_standard_ref = &base_standard_ref,
.min_frequency = LSM6DSO_ODR_MIN_VAL,
.max_frequency = LSM6DSO_ODR_MAX_VAL,
- .config = {
- [SENSOR_CONFIG_EC_S0] = {
- .odr = 13000 | ROUND_UP_FLAG,
- .ec_rate = 100 * MSEC,
- },
- [SENSOR_CONFIG_EC_S3] = {
- .odr = 10000 | ROUND_UP_FLAG,
- .ec_rate = 100 * MSEC,
- },
- },
},
[CLEAR_ALS] = {
diff --git a/board/felwinter/sensors.c b/board/felwinter/sensors.c
index 4a90179cf4..87025c017e 100644
--- a/board/felwinter/sensors.c
+++ b/board/felwinter/sensors.c
@@ -137,16 +137,6 @@ struct motion_sensor_t motion_sensors[] = {
.rot_standard_ref = &base_standard_ref,
.min_frequency = LSM6DSO_ODR_MIN_VAL,
.max_frequency = LSM6DSO_ODR_MAX_VAL,
- .config = {
- [SENSOR_CONFIG_EC_S0] = {
- .odr = 13000 | ROUND_UP_FLAG,
- .ec_rate = 100 * MSEC,
- },
- [SENSOR_CONFIG_EC_S3] = {
- .odr = 10000 | ROUND_UP_FLAG,
- .ec_rate = 100 * MSEC,
- },
- },
},
};
const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
diff --git a/board/kano/sensors.c b/board/kano/sensors.c
index f49c356a6f..0859e9082c 100644
--- a/board/kano/sensors.c
+++ b/board/kano/sensors.c
@@ -136,16 +136,6 @@ struct motion_sensor_t motion_sensors[] = {
.rot_standard_ref = &base_standard_ref,
.min_frequency = ICM426XX_GYRO_MIN_FREQ,
.max_frequency = ICM426XX_GYRO_MAX_FREQ,
- .config = {
- [SENSOR_CONFIG_EC_S0] = {
- .odr = 13000 | ROUND_UP_FLAG,
- .ec_rate = 100 * MSEC,
- },
- [SENSOR_CONFIG_EC_S3] = {
- .odr = 10000 | ROUND_UP_FLAG,
- .ec_rate = 100 * MSEC,
- },
- },
},
};
const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
diff --git a/board/rainier/board.c b/board/rainier/board.c
index 1581521d52..0f9c388399 100644
--- a/board/rainier/board.c
+++ b/board/rainier/board.c
@@ -404,13 +404,6 @@ struct motion_sensor_t motion_sensors[] = {
.rot_standard_ref = &base_standard_ref,
.min_frequency = BMI_GYRO_MIN_FREQ,
.max_frequency = BMI_GYRO_MAX_FREQ,
- .config = {
- /* Enable gyro in S0 */
- [SENSOR_CONFIG_EC_S0] = {
- .odr = 10000 | ROUND_UP_FLAG,
- .ec_rate = 100 * MSEC,
- },
- },
},
[LID_BARO] = {
.name = "Baro",
diff --git a/board/redrix/sensors.c b/board/redrix/sensors.c
index 7ed18197a5..f720a7cd32 100644
--- a/board/redrix/sensors.c
+++ b/board/redrix/sensors.c
@@ -195,16 +195,6 @@ struct motion_sensor_t motion_sensors[] = {
.rot_standard_ref = &base_standard_ref,
.min_frequency = LSM6DSM_ODR_MIN_VAL,
.max_frequency = LSM6DSM_ODR_MAX_VAL,
- .config = {
- [SENSOR_CONFIG_EC_S0] = {
- .odr = 13000 | ROUND_UP_FLAG,
- .ec_rate = 100 * MSEC,
- },
- [SENSOR_CONFIG_EC_S3] = {
- .odr = 10000 | ROUND_UP_FLAG,
- .ec_rate = 100 * MSEC,
- },
- },
},
[CLEAR_ALS] = {
diff --git a/board/taeko/sensors.c b/board/taeko/sensors.c
index 86d156596f..a199f18fcc 100644
--- a/board/taeko/sensors.c
+++ b/board/taeko/sensors.c
@@ -184,16 +184,6 @@ struct motion_sensor_t motion_sensors[] = {
.rot_standard_ref = &base_standard_ref,
.min_frequency = LSM6DSO_ODR_MIN_VAL,
.max_frequency = LSM6DSO_ODR_MAX_VAL,
- .config = {
- [SENSOR_CONFIG_EC_S0] = {
- .odr = 13000 | ROUND_UP_FLAG,
- .ec_rate = 100 * MSEC,
- },
- [SENSOR_CONFIG_EC_S3] = {
- .odr = 10000 | ROUND_UP_FLAG,
- .ec_rate = 100 * MSEC,
- },
- },
},
};
diff --git a/board/voema/sensors.c b/board/voema/sensors.c
index b76bf77036..005bad5af8 100644
--- a/board/voema/sensors.c
+++ b/board/voema/sensors.c
@@ -187,8 +187,6 @@ struct motion_sensor_t motion_sensors[] = {
},
},
},
- [BASE_GYRO] = {
- },
[CLEAR_ALS] = {
.name = "Clear Light",
.active_mask = SENSOR_ACTIVE_S0_S3,