diff options
-rw-r--r-- | driver/tcpm/tcpci.c | 17 | ||||
-rw-r--r-- | driver/tcpm/tcpci.h | 3 |
2 files changed, 14 insertions, 6 deletions
diff --git a/driver/tcpm/tcpci.c b/driver/tcpm/tcpci.c index d714b4d636..f05d9868e9 100644 --- a/driver/tcpm/tcpci.c +++ b/driver/tcpm/tcpci.c @@ -1301,6 +1301,7 @@ int tcpci_tcpm_init(int port) int error; int power_status; int tries = TCPM_INIT_TRIES; + int tcpc_ctrl; if (port >= board_get_usb_pd_port_count()) return EC_ERROR_INVAL; @@ -1320,18 +1321,24 @@ int tcpci_tcpm_init(int port) } /* + * Set TCPC_CONTROL.DebugAccessoryControl = 1 to control by TCPM, + * not TCPC. + */ + tcpc_ctrl = TCPC_REG_TCPC_CTRL_DEBUG_ACC_CONTROL; + + /* * For TCPCI Rev 2.0, unless the TCPM sets * TCPC_CONTROL.EnableLooking4ConnectionAlert bit, TCPC by default masks * Alert assertion when CC_STATUS.Looking4Connection changes state. */ if (tcpc_config[port].flags & TCPC_FLAGS_TCPCI_REV2_0) { - error = tcpc_update8(port, TCPC_REG_TCPC_CTRL, - TCPC_REG_TCPC_CTRL_EN_LOOK4CONNECTION_ALERT, - MASK_SET); - if (error) - CPRINTS("C%d: Failed to init TCPC_CTRL!", port); + tcpc_ctrl |= TCPC_REG_TCPC_CTRL_EN_LOOK4CONNECTION_ALERT; } + error = tcpc_update8(port, TCPC_REG_TCPC_CTRL, tcpc_ctrl, MASK_SET); + if (error) + CPRINTS("C%d: Failed to init TCPC_CTRL!", port); + /* * Handle and clear any alerts, since we might be coming out of low * power mode in response to an alert interrupt from the TCPC. diff --git a/driver/tcpm/tcpci.h b/driver/tcpm/tcpci.h index b19aca60a3..180e2c6103 100644 --- a/driver/tcpm/tcpci.h +++ b/driver/tcpm/tcpci.h @@ -63,7 +63,8 @@ * In TCPCI Rev 2.0, this bit must be set this to generate CC status alerts when * a connection is found. */ -#define TCPC_REG_TCPC_CTRL_EN_LOOK4CONNECTION_ALERT (BIT(6)) +#define TCPC_REG_TCPC_CTRL_EN_LOOK4CONNECTION_ALERT BIT(6) +#define TCPC_REG_TCPC_CTRL_DEBUG_ACC_CONTROL BIT(4) #define TCPC_REG_ROLE_CTRL 0x1a #define TCPC_REG_ROLE_CTRL_DRP_MASK BIT(6) |