From fe3a60e79265658a8e5336c0eaada4977e083cd3 Mon Sep 17 00:00:00 2001 From: Diana Z Date: Sat, 14 Aug 2021 15:05:26 -0600 Subject: 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 Change-Id: I19c3a65fc821a341338d73fabd7876339b37fe7d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3095437 Reviewed-by: Keith Short --- driver/usb_mux/virtual.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'driver/usb_mux/virtual.c') diff --git a/driver/usb_mux/virtual.c b/driver/usb_mux/virtual.c index 72020dda03..dbece4faf9 100644 --- a/driver/usb_mux/virtual.c +++ b/driver/usb_mux/virtual.c @@ -105,14 +105,13 @@ static int virtual_get_mux(const struct usb_mux *me, mux_state_t *mux_state) return EC_SUCCESS; } -void virtual_hpd_update(const struct usb_mux *me, int hpd_lvl, int hpd_irq) +void virtual_hpd_update(const struct usb_mux *me, mux_state_t mux_state) { int port = me->usb_port; bool unused; /* Current HPD related mux status + existing USB & DP mux status */ - mux_state_t new_mux_state = (hpd_lvl ? USB_PD_MUX_HPD_LVL : 0) | - (hpd_irq ? USB_PD_MUX_HPD_IRQ : 0) | + mux_state_t new_mux_state = mux_state | (virtual_mux_state[port] & USB_PD_MUX_USB_DP_STATE); /* HPD ACK isn't required for the EC to continue with its tasks */ -- cgit v1.2.1