summaryrefslogtreecommitdiff
path: root/driver/tcpm/anx7447.c
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2018-08-30 16:13:26 -0600
committerchrome-bot <chrome-bot@chromium.org>2018-09-05 16:11:04 -0700
commitdaed130e62e7332037e46c70277816e0630ad04a (patch)
treec43f204a27f41a41a46c41905957f104123934c0 /driver/tcpm/anx7447.c
parent4173a851603b2e00b241150092292b5a29ba3be2 (diff)
downloadchrome-ec-daed130e62e7332037e46c70277816e0630ad04a.tar.gz
ss-mux: update semantics for TCPC/MUX only used as MUX
This converts the compile time option of CONFIG_USB_PD_TCPM_TCPCI_MUX_ONLY into a runtime option to better support draggon egg designs and reduce CONFIG complexity in general. Introduce new mux_read/write to read from tcpc_config_t or mux driver depending on new flag setting. Audited all mux drivers for any use of tcpc_read/write and updated to mux_read/write. BRANCH=none BUG=b:110937880 TEST=On Bip with CL stack: Verified by connecting DP monitor at boot; Verified plug / unplug of DP cable works; Change-Id: I968893b886ff0ccc4074beae5ec42973814ae77c Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1200062 Commit-Ready: Gaggery Tsai <gaggery.tsai@intel.corp-partner.google.com> Reviewed-by: Scott Collyer <scollyer@chromium.org>
Diffstat (limited to 'driver/tcpm/anx7447.c')
-rw-r--r--driver/tcpm/anx7447.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/driver/tcpm/anx7447.c b/driver/tcpm/anx7447.c
index 0d263e6061..a6cfb75937 100644
--- a/driver/tcpm/anx7447.c
+++ b/driver/tcpm/anx7447.c
@@ -435,6 +435,15 @@ void anx7447_tcpc_update_hpd_status(int port, int hpd_lvl, int hpd_irq)
{
int reg = 0;
+ /*
+ * All calls within this method need to update to a mux_read/write calls
+ * that use the secondary address. This is a non-trival change and no
+ * one is using the anx7447 as a mux only (and probably never will since
+ * it doesn't have a re-driver). If that changes, we need to update this
+ * code.
+ */
+ ASSERT(!(usb_muxes[port].flags & USB_MUX_FLAG_NOT_TCPC));
+
anx7447_set_hpd_level(port, hpd_lvl);
if (hpd_irq) {
@@ -524,9 +533,9 @@ static int anx7447_mux_set(int port, mux_state_t mux_state)
sw_sel = 0x10;
}
}
- rv = tcpc_write(port, ANX7447_REG_TCPC_SWITCH_0, sw_sel);
- rv |= tcpc_write(port, ANX7447_REG_TCPC_SWITCH_1, sw_sel);
- rv |= tcpc_write(port, ANX7447_REG_TCPC_AUX_SWITCH, aux_sw);
+ rv = mux_write(port, ANX7447_REG_TCPC_SWITCH_0, sw_sel);
+ rv |= mux_write(port, ANX7447_REG_TCPC_SWITCH_1, sw_sel);
+ rv |= mux_write(port, ANX7447_REG_TCPC_AUX_SWITCH, aux_sw);
anx[port].mux_state = mux_state;