diff options
author | Wai-Hong Tam <waihong@google.com> | 2020-01-14 10:48:15 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-01-16 21:50:15 +0000 |
commit | 59bf4eeb0940deee91ba3c5a3d80e1fb39e966e6 (patch) | |
tree | df2e7e6258185834ddd20c954e31884da30ac2bb /board | |
parent | d57264e2872a5e54ae553c1c324ff3ef5b937263 (diff) | |
download | chrome-ec-59bf4eeb0940deee91ba3c5a3d80e1fb39e966e6.tar.gz |
Trogdor: Abandon virtual HPD approach and configure TCPC for HPD status
The TCPC is required to know the HPD status; otherwise, some mux
misbehaves. Even thought the HPD status is through a GPIO to notify AP,
still configure the TCPC.
As the GPIO approach works well, abandon the virtual HPD approach.
BRANCH=None
BUG=b:147358149
TEST=Plugged a Type-C to DP dongle to the board, checked that the IN_HPD
bit not set. Plugged a monitor to the dongle, checked that the IN_HPD
bit set.
Change-Id: Id8b8eae462c80c36156a1e9443c8af87cd784fd0
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2003531
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/trogdor/board.c | 52 | ||||
-rw-r--r-- | board/trogdor/board.h | 1 | ||||
-rw-r--r-- | board/trogdor/usb_pd_policy.c | 4 |
3 files changed, 8 insertions, 49 deletions
diff --git a/board/trogdor/board.c b/board/trogdor/board.c index d9c30571d3..202671651c 100644 --- a/board/trogdor/board.c +++ b/board/trogdor/board.c @@ -244,56 +244,18 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = { /* * Port-0/1 USB mux driver. * - * The USB mux is handled by TCPC chip and the HPD is handled by AP. - * Redirect to tcpci_tcpm_usb_mux_driver but override the get() function - * to check the HPD_IRQ mask from virtual_usb_mux_driver. - * - * Both port 0 and 1 use the same TCPC part. + * The USB mux is handled by TCPC chip and the HPD update is through a GPIO + * to AP. But the TCPC chip is also needed to know the HPD status; otherwise, + * the mux misbehaves. */ - -static int port_usb_mux_init(int port) -{ - return tcpci_tcpm_usb_mux_driver.init(port); -} - -static int port_usb_mux_set(int i2c_addr, mux_state_t mux_state) -{ - return tcpci_tcpm_usb_mux_driver.set(i2c_addr, mux_state); -} - -static int port_usb_mux_get(int port, mux_state_t *mux_state) -{ - int rv; - mux_state_t virtual_mux_state; - - rv = tcpci_tcpm_usb_mux_driver.get(port, mux_state); - rv |= virtual_usb_mux_driver.get(port, &virtual_mux_state); - - if (virtual_mux_state & USB_PD_MUX_HPD_IRQ) - *mux_state |= USB_PD_MUX_HPD_IRQ; - return rv; -} - -static int port_usb_mux_enter_low_power(int port) -{ - return tcpci_tcpm_usb_mux_driver.enter_low_power_mode(port); -} - -const struct usb_mux_driver port_usb_mux_driver = { - .init = &port_usb_mux_init, - .set = &port_usb_mux_set, - .get = &port_usb_mux_get, - .enter_low_power_mode = &port_usb_mux_enter_low_power, -}; - struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { { - .driver = &port_usb_mux_driver, - .hpd_update = &virtual_hpd_update, + .driver = &ps8xxx_usb_mux_driver, + .hpd_update = &ps8xxx_tcpc_update_hpd_status, }, { - .driver = &port_usb_mux_driver, - .hpd_update = &virtual_hpd_update, + .driver = &ps8xxx_usb_mux_driver, + .hpd_update = &ps8xxx_tcpc_update_hpd_status, } }; diff --git a/board/trogdor/board.h b/board/trogdor/board.h index 5052da4b1f..915375d719 100644 --- a/board/trogdor/board.h +++ b/board/trogdor/board.h @@ -115,7 +115,6 @@ #define CONFIG_USB_PD_TRY_SRC #define CONFIG_USB_PD_VBUS_DETECT_CHARGER #define CONFIG_USB_PD_5V_EN_CUSTOM -#define CONFIG_USB_MUX_VIRTUAL #define CONFIG_USBC_PPC_SN5S330 #define CONFIG_USBC_SS_MUX #define CONFIG_USBC_VCONN diff --git a/board/trogdor/usb_pd_policy.c b/board/trogdor/usb_pd_policy.c index ce72340bd3..0fbfd9013e 100644 --- a/board/trogdor/usb_pd_policy.c +++ b/board/trogdor/usb_pd_policy.c @@ -216,9 +216,7 @@ __override int svdm_dp_attention(int port, uint32_t *payload) */ pd_notify_dp_alt_mode_entry(); - /* TODO(waihong): Keep only one of the following ways to signal AP */ - - /* Signal AP for the HPD event, through EC host event */ + /* Configure TCPC for the HPD event, for proper muxing */ mux->hpd_update(port, lvl, irq); /* Signal AP for the HPD event, through GPIO to AP */ |