summaryrefslogtreecommitdiff
path: root/baseboard
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2021-08-14 15:05:26 -0600
committerCommit Bot <commit-bot@chromium.org>2021-08-30 20:33:28 +0000
commitfe3a60e79265658a8e5336c0eaada4977e083cd3 (patch)
tree09db3f89c5eb663daca1e5a1ed2b20708f37ab5c /baseboard
parentd32885333e9bba9915d5388b08e888e06dfad511 (diff)
downloadchrome-ec-fe3a60e79265658a8e5336c0eaada4977e083cd3.tar.gz
USB MUX: Convert usb_mux HPD functions to use mux_state_t
Since we have definitions for HPD IRQ and level in the mux flags, extend this to the HPD update function in the usb_mux structure as well. BRANCH=None BUG=b:172222942 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I19c3a65fc821a341338d73fabd7876339b37fe7d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3095437 Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'baseboard')
-rw-r--r--baseboard/octopus/variant_usbc_ec_tcpcs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/baseboard/octopus/variant_usbc_ec_tcpcs.c b/baseboard/octopus/variant_usbc_ec_tcpcs.c
index fa34ffaf18..2e3248410f 100644
--- a/baseboard/octopus/variant_usbc_ec_tcpcs.c
+++ b/baseboard/octopus/variant_usbc_ec_tcpcs.c
@@ -49,8 +49,10 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = {
/* TODO(crbug.com/826441): Consolidate this logic with other impls */
static void board_it83xx_hpd_status(const struct usb_mux *me,
- int hpd_lvl, int hpd_irq)
+ mux_state_t mux_state)
{
+ int hpd_lvl = (mux_state & USB_PD_MUX_HPD_LVL) ? 1 : 0;
+ int hpd_irq = (mux_state & USB_PD_MUX_HPD_IRQ) ? 1 : 0;
enum gpio_signal gpio = me->usb_port ?
GPIO_USB_C1_HPD_1V8_ODL : GPIO_USB_C0_HPD_1V8_ODL;