summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2021-10-21 23:20:10 +0000
committerCommit Bot <commit-bot@chromium.org>2021-10-25 18:03:14 +0000
commitd4531ba075b951d19df3eb49074073b535be86d2 (patch)
treee9ae89be9ac1f118174ebf6c3e7729dec9f23879 /board
parent03874334eac1b2bf77e33ea60a6587e6801faf6a (diff)
downloadchrome-ec-d4531ba075b951d19df3eb49074073b535be86d2.tar.gz
baseboard/zork: Unify enum types
enum ec_ssfc_base_gyro_sensor and enum ec_cfg_base_gyro_sensor_type have the same values. clang warns that we're trying to convert between these two types: board/morphius/board.c:257:10: error: implicit conversion from enumeration type 'enum ec_ssfc_base_gyro_sensor' to different enumeration type 'enum ec_cfg_base_gyro_sensor_type' [-Werror,-Wenum-conversion] return get_cbi_ssfc_base_sensor(); Rather than duplicate the type (and it accidentally getting out of sync), just use the canonical base type. BRANCH=none BUG=b:172020503 TEST=./util/compare_builds.sh -b all -j 120 => All match, except ezkinil due to the change of the base_gyro_config variable from "int" to "enum" Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I8168518a87469004c33adebed89879225c470ace Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3238249 Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/ezkinil/board.c10
-rw-r--r--board/morphius/board.c12
2 files changed, 11 insertions, 11 deletions
diff --git a/board/ezkinil/board.c b/board/ezkinil/board.c
index 14f8e6e915..418ca353c9 100644
--- a/board/ezkinil/board.c
+++ b/board/ezkinil/board.c
@@ -309,27 +309,27 @@ const struct usb_mux usbc0_sbu_mux = {
* Base Gyro Sensor dynamic configuration
*/
-static int base_gyro_config;
+static enum ec_ssfc_base_gyro_sensor base_gyro_config = SSFC_BASE_GYRO_NONE;
static void setup_base_gyro_config(void)
{
base_gyro_config = ec_config_has_base_gyro_sensor();
- if (base_gyro_config == BASE_GYRO_ICM426XX) {
+ if (base_gyro_config == SSFC_BASE_GYRO_ICM426XX) {
motion_sensors[BASE_ACCEL] = icm426xx_base_accel;
motion_sensors[BASE_GYRO] = icm426xx_base_gyro;
ccprints("BASE GYRO is ICM426XX");
- } else if (base_gyro_config == BASE_GYRO_BMI160)
+ } else if (base_gyro_config == SSFC_BASE_GYRO_BMI160)
ccprints("BASE GYRO is BMI160");
}
void motion_interrupt(enum gpio_signal signal)
{
switch (base_gyro_config) {
- case BASE_GYRO_ICM426XX:
+ case SSFC_BASE_GYRO_ICM426XX:
icm426xx_interrupt(signal);
break;
- case BASE_GYRO_BMI160:
+ case SSFC_BASE_GYRO_BMI160:
default:
bmi160_interrupt(signal);
break;
diff --git a/board/morphius/board.c b/board/morphius/board.c
index 48712ffb0c..8e0577b133 100644
--- a/board/morphius/board.c
+++ b/board/morphius/board.c
@@ -246,9 +246,9 @@ const struct pi3hdx1204_tuning pi3hdx1204_tuning = {
/*****************************************************************************
* Base Gyro Sensor dynamic configuration
*/
-static enum ec_cfg_base_gyro_sensor_type base_gyro_config;
+static enum ec_ssfc_base_gyro_sensor base_gyro_config = SSFC_BASE_GYRO_NONE;
-enum ec_cfg_base_gyro_sensor_type get_base_gyro_sensor(void)
+enum ec_ssfc_base_gyro_sensor get_base_gyro_sensor(void)
{
switch (get_cbi_ssfc_base_sensor()) {
case SSFC_BASE_GYRO_NONE:
@@ -263,10 +263,10 @@ static void setup_base_gyro_config(void)
base_gyro_config = get_base_gyro_sensor();
switch (base_gyro_config) {
- case BASE_GYRO_BMI160:
+ case SSFC_BASE_GYRO_BMI160:
ccprints("BASE GYRO is BMI160");
break;
- case BASE_GYRO_ICM426XX:
+ case SSFC_BASE_GYRO_ICM426XX:
motion_sensors[BASE_ACCEL] = icm426xx_base_accel;
motion_sensors[BASE_GYRO] = icm426xx_base_gyro;
ccprints("BASE GYRO is ICM426XX");
@@ -279,10 +279,10 @@ static void setup_base_gyro_config(void)
void motion_interrupt(enum gpio_signal signal)
{
switch (base_gyro_config) {
- case BASE_GYRO_BMI160:
+ case SSFC_BASE_GYRO_BMI160:
bmi160_interrupt(signal);
break;
- case BASE_GYRO_ICM426XX:
+ case SSFC_BASE_GYRO_ICM426XX:
icm426xx_interrupt(signal);
break;
default: