mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-08 16:41:55 +00:00
The anx74xx tcpm driver for the usb_mux_set() function is always connecting the DP aux lines to the SBU signals regardless of whether the bit flag MUX_DP_ENABLED was set or not. For CCD opertation the sbu lines are used to establish a USB connection to H1. This means that if a PD port ever attaches to a sink debug accessory, usb_mux_set would result in interrupting the USB connection being used for CCD. In addition, the anx74xx_tcpm_mux_exit() function had a bug where the value read from ANALOG_CTRL_5 was being masked by 0x09 and then written to ANALOG_CTRL_2. Added functions anx74xx_tcpm_mux_enter_safe_mode() and anx74xx_tcpm_mux_exit_safe_mode() so that writes to the 3 CTRL registers that are used to configure ALT_DP mode can be easily bookended. BUG=b:36007652 BRANCH=reef TEST=Connected servo_v4 to port 0 of electro, verified that H1 console access worked. Then initiated a data role swap so that port 0 on electro was in DFP mode and the H1 console stayed connected. - Tested with dingdong that could connect to a 4k monitor. - Tested with USB3 flash drive. - Tested Anker USBC -> USBA hub Change-Id: I2d045134fbdd21b6b492bbeabc85ab23aef73b9a Signed-off-by: Scott <scollyer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/451837 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: S Wang <swang@analogix.corp-partner.google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>