From 7c20200967b367a8996866f51868feec483f1429 Mon Sep 17 00:00:00 2001 From: Diana Z Date: Wed, 23 Jan 2019 11:03:48 -0700 Subject: Casta: Tune USB mux registers Casta is currently having issues with its Rx measurement on port 0. With this change, the mux registers on the PS8751 for port 0 should be tuned every time the TCPC comes out of low power mode. BUG=b:122987819 BRANCH=octopus TEST=builds, loaded onto casta and confirmed register 0xE7 read 0x40 from the ec console Change-Id: Ieb884eeaddc418f97ace69b9db0041d50fe2b5d9 Signed-off-by: Diana Z Reviewed-on: https://chromium-review.googlesource.com/1430953 Commit-Ready: YongBeum Ha Tested-by: YongBeum Ha Reviewed-by: Jett Rink --- baseboard/octopus/variant_usbc_standalone_tcpcs.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/baseboard/octopus/variant_usbc_standalone_tcpcs.c b/baseboard/octopus/variant_usbc_standalone_tcpcs.c index d2da4595bb..fbae3e70d0 100644 --- a/baseboard/octopus/variant_usbc_standalone_tcpcs.c +++ b/baseboard/octopus/variant_usbc_standalone_tcpcs.c @@ -53,11 +53,21 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = { /******************************************************************************/ /* USB-C MUX Configuration */ +#if defined(VARIANT_OCTOPUS_TCPC_0_PS8751) +static int ps8751_tune_mux(int port) +{ + /* Tune USB mux registers for casta's port 0 Rx measurement */ + mux_write(port, PS8XXX_REG_MUX_USB_C2SS_EQ, 0x40); + return EC_SUCCESS; +} +#endif + struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = { [USB_PD_PORT_TCPC_0] = { #if defined(VARIANT_OCTOPUS_TCPC_0_PS8751) .driver = &tcpci_tcpm_usb_mux_driver, .hpd_update = &ps8xxx_tcpc_update_hpd_status, + .board_init = &ps8751_tune_mux, #else .driver = &anx7447_usb_mux_driver, .hpd_update = &anx7447_tcpc_update_hpd_status, -- cgit v1.2.1