diff options
author | Tom Hughes <tomhughes@chromium.org> | 2021-10-21 23:20:10 +0000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-10-25 18:03:14 +0000 |
commit | d4531ba075b951d19df3eb49074073b535be86d2 (patch) | |
tree | e9ae89be9ac1f118174ebf6c3e7729dec9f23879 /baseboard | |
parent | 03874334eac1b2bf77e33ea60a6587e6801faf6a (diff) | |
download | chrome-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 'baseboard')
-rw-r--r-- | baseboard/zork/cbi_ec_fw_config.c | 2 | ||||
-rw-r--r-- | baseboard/zork/cbi_ec_fw_config.h | 10 |
2 files changed, 4 insertions, 8 deletions
diff --git a/baseboard/zork/cbi_ec_fw_config.c b/baseboard/zork/cbi_ec_fw_config.c index cbb0821c42..50a29d3634 100644 --- a/baseboard/zork/cbi_ec_fw_config.c +++ b/baseboard/zork/cbi_ec_fw_config.c @@ -53,7 +53,7 @@ enum ec_cfg_lid_accel_sensor_type ec_config_has_lid_accel_sensor(void) /* * ec_config_has_base_gyro_sensor() will return ec_cfg_base_gyro_sensor_type */ -enum ec_cfg_base_gyro_sensor_type ec_config_has_base_gyro_sensor(void) +enum ec_ssfc_base_gyro_sensor ec_config_has_base_gyro_sensor(void) { return ((get_cbi_fw_config() & EC_CFG_BASE_GYRO_SENSOR_MASK) >> EC_CFG_BASE_GYRO_SENSOR_L); diff --git a/baseboard/zork/cbi_ec_fw_config.h b/baseboard/zork/cbi_ec_fw_config.h index 4888298e3a..c3ed5b654c 100644 --- a/baseboard/zork/cbi_ec_fw_config.h +++ b/baseboard/zork/cbi_ec_fw_config.h @@ -6,6 +6,8 @@ #ifndef _ZORK_CBI_EC_FW_CONFIG__H_ #define _ZORK_CBI_EC_FW_CONFIG__H_ +#include "cbi_ssfc.h" + /**************************************************************************** * CBI Zork EC FW Configuration */ @@ -56,12 +58,6 @@ enum ec_cfg_lid_accel_sensor_type { * * ec_config_has_base_gyro_sensor() will return ec_cfg_base_gyro_sensor_type */ -enum ec_cfg_base_gyro_sensor_type { - BASE_GYRO_NONE = 0, - BASE_GYRO_BMI160 = 1, - BASE_GYRO_LSM6DSM = 2, - BASE_GYRO_ICM426XX = 3, -}; #define EC_CFG_BASE_GYRO_SENSOR_L 11 #define EC_CFG_BASE_GYRO_SENSOR_H 13 #define EC_CFG_BASE_GYRO_SENSOR_MASK \ @@ -133,7 +129,7 @@ uint32_t get_cbi_fw_config(void); enum ec_cfg_usb_db_type ec_config_get_usb_db(void); enum ec_cfg_usb_mb_type ec_config_get_usb_mb(void); enum ec_cfg_lid_accel_sensor_type ec_config_has_lid_accel_sensor(void); -enum ec_cfg_base_gyro_sensor_type ec_config_has_base_gyro_sensor(void); +enum ec_ssfc_base_gyro_sensor ec_config_has_base_gyro_sensor(void); enum ec_cfg_pwm_keyboard_backlight_type ec_config_has_pwm_keyboard_backlight( void); enum ec_cfg_lid_angle_tablet_mode_type ec_config_has_lid_angle_tablet_mode( |