summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2021-08-14 22:58:16 -0600
committerCommit Bot <commit-bot@chromium.org>2021-09-16 17:14:04 +0000
commitabc6c7ad71d85532db725198cecab0aa282e7b50 (patch)
tree49b217857e2079e69a4a7f472eddb95a83adff19 /common
parent414feb169e244b2037e6a92a45500cc73faeea08 (diff)
downloadchrome-ec-abc6c7ad71d85532db725198cecab0aa282e7b50.tar.gz
USB MUX: Update mux HPD update interface to use mux_state_t
Since the drivers are now taking a mux_state_t set of flags to update, go ahead and unify the usb_mux API this way as well. It makes the parameters more apparent than the 1/0 inputs, and aligns the stack to use the same parameters. BRANCH=None BUG=b:172222942 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ie943dbdf03818d8497c0e328adf2b9794585d96e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3095438 Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/usb_pd_alt_mode_dfp.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/common/usb_pd_alt_mode_dfp.c b/common/usb_pd_alt_mode_dfp.c
index d04c9e18b2..49fbf4cc65 100644
--- a/common/usb_pd_alt_mode_dfp.c
+++ b/common/usb_pd_alt_mode_dfp.c
@@ -1325,7 +1325,8 @@ __overridable void svdm_dp_post_config(int port)
svdm_hpd_deadline[port] = get_time().val + HPD_USTREAM_DEBOUNCE_LVL;
#endif /* CONFIG_USB_PD_DP_HPD_GPIO */
- usb_mux_hpd_update(port, 1, 0);
+ usb_mux_hpd_update(port, USB_PD_MUX_HPD_LVL |
+ USB_PD_MUX_HPD_IRQ_DEASSERTED);
#ifdef USB_PD_PORT_TCPC_MST
if (port == USB_PD_PORT_TCPC_MST)
@@ -1340,6 +1341,7 @@ __overridable int svdm_dp_attention(int port, uint32_t *payload)
#ifdef CONFIG_USB_PD_DP_HPD_GPIO
int cur_lvl = svdm_get_hpd_gpio(port);
#endif /* CONFIG_USB_PD_DP_HPD_GPIO */
+ mux_state_t mux_state;
dp_status[port] = payload[1];
@@ -1387,7 +1389,9 @@ __overridable int svdm_dp_attention(int port, uint32_t *payload)
svdm_hpd_deadline[port] = get_time().val + HPD_USTREAM_DEBOUNCE_LVL;
#endif /* CONFIG_USB_PD_DP_HPD_GPIO */
- usb_mux_hpd_update(port, lvl, irq);
+ mux_state = (lvl ? USB_PD_MUX_HPD_LVL : USB_PD_MUX_HPD_LVL_DEASSERTED) |
+ (irq ? USB_PD_MUX_HPD_IRQ : USB_PD_MUX_HPD_IRQ_DEASSERTED);
+ usb_mux_hpd_update(port, mux_state);
#ifdef USB_PD_PORT_TCPC_MST
if (port == USB_PD_PORT_TCPC_MST)
@@ -1405,7 +1409,8 @@ __overridable void svdm_exit_dp_mode(int port)
#ifdef CONFIG_USB_PD_DP_HPD_GPIO
svdm_set_hpd_gpio(port, 0);
#endif /* CONFIG_USB_PD_DP_HPD_GPIO */
- usb_mux_hpd_update(port, 0, 0);
+ usb_mux_hpd_update(port, USB_PD_MUX_HPD_LVL_DEASSERTED |
+ USB_PD_MUX_HPD_IRQ_DEASSERTED);
#ifdef USB_PD_PORT_TCPC_MST
if (port == USB_PD_PORT_TCPC_MST)
baseboard_mst_enable_control(port, 0);