diff options
-rw-r--r-- | driver/usb_mux/virtual.c | 4 | ||||
-rw-r--r-- | include/usb_mux.h | 11 |
2 files changed, 9 insertions, 6 deletions
diff --git a/driver/usb_mux/virtual.c b/driver/usb_mux/virtual.c index 417a48c577..dc6f4c3334 100644 --- a/driver/usb_mux/virtual.c +++ b/driver/usb_mux/virtual.c @@ -107,14 +107,14 @@ 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, mux_state_t mux_state, +void virtual_hpd_update(const struct usb_mux *me, mux_state_t hpd_state, bool *ack_required) { int port = me->usb_port; /* Current HPD related mux status + existing USB & DP mux status */ mux_state_t new_mux_state = - mux_state | (virtual_mux_state[port] & USB_PD_MUX_USB_DP_STATE); + hpd_state | (virtual_mux_state[port] & USB_PD_MUX_USB_DP_STATE); virtual_mux_update_state(port, new_mux_state, ack_required); } diff --git a/include/usb_mux.h b/include/usb_mux.h index bc89c0ea85..90edbb98d7 100644 --- a/include/usb_mux.h +++ b/include/usb_mux.h @@ -33,6 +33,9 @@ #endif /* CONFIG_ZEPHYR */ +/* usb_mux.hpd_update API only specifies 2 relevant bits in mux_state */ +#define MUX_STATE_HPD_UPDATE_MASK (USB_PD_MUX_HPD_LVL | USB_PD_MUX_HPD_IRQ) + /* * USB-C mux state * @@ -168,11 +171,11 @@ struct usb_mux { * * @param[in] me usb_mux * @param[in] mux_state with HPD IRQ and HPD LVL flags set - * accordingly + * accordingly. Other flags are undefined. * @param[out] ack_required: indication of whether this function * requires a wait for an AP ACK after */ - void (*hpd_update)(const struct usb_mux *me, mux_state_t mux_state, + void (*hpd_update)(const struct usb_mux *me, mux_state_t hpd_state, bool *ack_required); }; @@ -206,7 +209,7 @@ extern const struct usb_mux_chain usb_muxes[]; #endif /* Supported hpd_update functions */ -void virtual_hpd_update(const struct usb_mux *me, mux_state_t mux_state, +void virtual_hpd_update(const struct usb_mux *me, mux_state_t hpd_state, bool *ack_required); /* @@ -300,7 +303,7 @@ void usb_mux_flip(int port); * @param port port number. * @param mux_state HPD IRQ and LVL mux flags */ -void usb_mux_hpd_update(int port, mux_state_t mux_state); +void usb_mux_hpd_update(int port, mux_state_t hpd_state); /** * Port information about retimer firmware update support. |