summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2022-10-13 13:34:45 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-10-17 22:57:18 +0000
commitb5ec6ecf73d287551fb2e2def5c23022c9533b43 (patch)
treeaab17f6c73350cb6dea95e5f64947249b5594adf
parenteae5e48f0a3e741578914bd21a49fb5fe6f6ed63 (diff)
downloadchrome-ec-b5ec6ecf73d287551fb2e2def5c23022c9533b43.tar.gz
baseboard/intelrvp: Add casts
When building with clang it warns: baseboard/intelrvp/adlrvp.c:235:23: error: implicit conversion from enumeration type 'enum ioex_signal' to different enumeration type 'enum gpio_signal' [-Werror,-Wenum-conversion] .retimer_rst_gpio = IOEX_USB_C3_BB_RETIMER_RST, ^~~~~~~~~~~~~~~~~~~~~~~~~~ baseboard/intelrvp/adlrvp.c:236:21: error: implicit conversion from enumeration type 'enum ioex_signal' to different enumeration type 'enum gpio_signal' [-Werror,-Wenum-conversion] .usb_ls_en_gpio = IOEX_USB_C3_BB_RETIMER_LS_EN, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ baseboard/intelrvp/adlrvp.c:310:44: error: implicit conversion from enumeration type 'const enum gpio_signal' to different enumeration type 'enum ioex_signal' [-Werror,-Wenum-conversion] ioex_set_level(bb_controls[me->usb_port].usb_ls_en_gpio, 1); ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ baseboard/intelrvp/adlrvp.c:319:44: error: implicit conversion from enumeration type 'const enum gpio_signal' to different enumeration type 'enum ioex_signal' [-Werror,-Wenum-conversion] ioex_set_level(bb_controls[me->usb_port].retimer_rst_gpio, 1); ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ BRANCH=none BUG=b:172020503 TEST=./util/compare_build.sh -b all -j 120 => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I5ba7821d47b07a14925274fadbfaf963d061a4b6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3953253 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r--baseboard/intelrvp/adlrvp.c40
1 files changed, 28 insertions, 12 deletions
diff --git a/baseboard/intelrvp/adlrvp.c b/baseboard/intelrvp/adlrvp.c
index ed1a848708..35ed0edf32 100644
--- a/baseboard/intelrvp/adlrvp.c
+++ b/baseboard/intelrvp/adlrvp.c
@@ -215,25 +215,33 @@ struct usb_mux_chain soc_side_bb_retimer1_usb_mux = {
const struct bb_usb_control bb_controls[] = {
[TYPE_C_PORT_0] = {
- .retimer_rst_gpio = IOEX_USB_C0_BB_RETIMER_RST,
- .usb_ls_en_gpio = IOEX_USB_C0_BB_RETIMER_LS_EN,
+ .retimer_rst_gpio = (enum gpio_signal)
+ IOEX_USB_C0_BB_RETIMER_RST,
+ .usb_ls_en_gpio = (enum gpio_signal)
+ IOEX_USB_C0_BB_RETIMER_LS_EN,
},
#if defined(HAS_TASK_PD_C1)
[TYPE_C_PORT_1] = {
- .retimer_rst_gpio = IOEX_USB_C1_BB_RETIMER_RST,
- .usb_ls_en_gpio = IOEX_USB_C1_BB_RETIMER_LS_EN,
+ .retimer_rst_gpio = (enum gpio_signal)
+ IOEX_USB_C1_BB_RETIMER_RST,
+ .usb_ls_en_gpio = (enum gpio_signal)
+ IOEX_USB_C1_BB_RETIMER_LS_EN,
},
#endif
#if defined(HAS_TASK_PD_C2)
[TYPE_C_PORT_2] = {
- .retimer_rst_gpio = IOEX_USB_C2_BB_RETIMER_RST,
- .usb_ls_en_gpio = IOEX_USB_C2_BB_RETIMER_LS_EN,
+ .retimer_rst_gpio = (enum gpio_signal)
+ IOEX_USB_C2_BB_RETIMER_RST,
+ .usb_ls_en_gpio = (enum gpio_signal)
+ IOEX_USB_C2_BB_RETIMER_LS_EN,
},
#endif
#if defined(HAS_TASK_PD_C3)
[TYPE_C_PORT_3] = {
- .retimer_rst_gpio = IOEX_USB_C3_BB_RETIMER_RST,
- .usb_ls_en_gpio = IOEX_USB_C3_BB_RETIMER_LS_EN,
+ .retimer_rst_gpio = (enum gpio_signal)
+ IOEX_USB_C3_BB_RETIMER_RST,
+ .usb_ls_en_gpio = (enum gpio_signal)
+ IOEX_USB_C3_BB_RETIMER_LS_EN,
},
#endif
};
@@ -307,7 +315,9 @@ __override int bb_retimer_power_enable(const struct usb_mux *me, bool enable)
/* Handle retimer's power domain.*/
if (enable) {
- ioex_set_level(bb_controls[me->usb_port].usb_ls_en_gpio, 1);
+ ioex_set_level((enum ioex_signal)bb_controls[me->usb_port]
+ .usb_ls_en_gpio,
+ 1);
/*
* minimum time from VCC to RESET_N de-assertion is 100us
@@ -316,7 +326,9 @@ __override int bb_retimer_power_enable(const struct usb_mux *me, bool enable)
* this function.
*/
msleep(1);
- ioex_set_level(bb_controls[me->usb_port].retimer_rst_gpio, 1);
+ ioex_set_level((enum ioex_signal)bb_controls[me->usb_port]
+ .retimer_rst_gpio,
+ 1);
/*
* Allow 1ms time for the retimer to power up lc_domain
@@ -325,9 +337,13 @@ __override int bb_retimer_power_enable(const struct usb_mux *me, bool enable)
msleep(1);
} else {
- ioex_set_level(bb_controls[me->usb_port].retimer_rst_gpio, 0);
+ ioex_set_level((enum ioex_signal)bb_controls[me->usb_port]
+ .retimer_rst_gpio,
+ 0);
msleep(1);
- ioex_set_level(bb_controls[me->usb_port].usb_ls_en_gpio, 0);
+ ioex_set_level((enum ioex_signal)bb_controls[me->usb_port]
+ .usb_ls_en_gpio,
+ 0);
}
return EC_SUCCESS;
}