mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-29 10:00:51 +00:00
tcpm: anx74xx: Initialize regs for proper CC cye diagram
BUG=chrome-os-partner:56788 BRANCH=None TEST=Verify CC eye diagram looks better. Change-Id: I4880e81b0a4737a303027513e77c9a66845472e2 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/380352 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Kevin K Wong <kevin.k.wong@intel.com> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
838babebd9
commit
a87663f6dc
@@ -150,10 +150,17 @@ static int anx74xx_tcpm_mux_exit(int port)
|
||||
rv = tcpc_read(port, ANX74XX_REG_ANALOG_CTRL_2, ®);
|
||||
if (rv)
|
||||
return EC_ERROR_UNKNOWN;
|
||||
|
||||
rv |= tcpc_write(port, ANX74XX_REG_ANALOG_CTRL_2, reg | ANX74XX_REG_MODE_TRANS);
|
||||
|
||||
/* Clear Bit[7:0] R_SWITCH */
|
||||
rv |= tcpc_write(port, ANX74XX_REG_ANALOG_CTRL_1, 0x0);
|
||||
rv |= tcpc_write(port, ANX74XX_REG_ANALOG_CTRL_5, 0x04);
|
||||
|
||||
/* Clear Bit[7:4] R_SWITCH_H */
|
||||
rv |= tcpc_read(port, ANX74XX_REG_ANALOG_CTRL_5, ®);
|
||||
if (rv)
|
||||
return EC_ERROR_UNKNOWN;
|
||||
rv |= tcpc_write(port, ANX74XX_REG_ANALOG_CTRL_5, (reg & 0x0f));
|
||||
|
||||
rv |= tcpc_write(port, ANX74XX_REG_ANALOG_CTRL_2, reg & 0x09);
|
||||
if (rv)
|
||||
return EC_ERROR_UNKNOWN;
|
||||
@@ -845,6 +852,14 @@ int anx74xx_tcpm_init(int port)
|
||||
/* HPD pin output enable*/
|
||||
rv |= tcpc_write(port, ANX74XX_REG_HPD_CTRL_0, ANX74XX_REG_HPD_DEFAULT);
|
||||
|
||||
if (rv)
|
||||
return EC_ERROR_UNKNOWN;
|
||||
|
||||
/* Set AVDD10_BMC to 1.08 */
|
||||
rv |= tcpc_read(port, ANX74XX_REG_ANALOG_CTRL_5, ®);
|
||||
if (rv)
|
||||
return EC_ERROR_UNKNOWN;
|
||||
rv = tcpc_write(port, ANX74XX_REG_ANALOG_CTRL_5, (reg & 0xf3));
|
||||
if (rv)
|
||||
return EC_ERROR_UNKNOWN;
|
||||
|
||||
@@ -856,6 +871,11 @@ int anx74xx_tcpm_init(int port)
|
||||
if (rv)
|
||||
return EC_ERROR_UNKNOWN;
|
||||
|
||||
/* Set BMC TX cap slew rate to 400ns */
|
||||
rv = tcpc_write(port, ANX74XX_REG_ANALOG_CTRL_12, 0x4);
|
||||
if (rv)
|
||||
return EC_ERROR_UNKNOWN;
|
||||
|
||||
#ifdef CONFIG_USB_PD_TCPC_FW_VERSION
|
||||
board_print_tcpc_fw_version(port);
|
||||
#endif
|
||||
|
||||
@@ -82,6 +82,7 @@
|
||||
#define ANX74XX_REG_AUX_SWAP_SET_CC2 0xc0
|
||||
|
||||
#define ANX74XX_REG_ANALOG_CTRL_11 0x4c
|
||||
#define ANX74XX_REG_ANALOG_CTRL_12 0x4d
|
||||
|
||||
#define ANX74XX_REG_MUX_DP_MODE_ACE_CC1 0x49
|
||||
#define ANX74XX_REG_MUX_DP_MODE_ACE_CC2 0x86
|
||||
|
||||
Reference in New Issue
Block a user