waddledoo: Enable TCPCI Rev2 v1.0 for TCPCs

The RAA489000 TCPCs that waddledoo is using are a TCPCI Rev2 TCPC.
Unfortunately, there seems to be some problems with the TCPCI Rev1 mode,
so enable TCPCI Rev2 mode instead which seems to work with the newly
added TCPCI Rev2 support.

BUG=b:147316570
BRANCH=None
TEST=Build and flash waddledoo, verify that TCPC can receive and
transmit PD messages.

Change-Id: If8fb434d865bf5a6f0439707581ca92cb3e7731d
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2006711
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
This commit is contained in:
Aseda Aboagye 2020-01-16 21:41:26 -08:00 committed by Commit Bot
parent 5c95136c7f
commit cb5112309f
1 changed files with 6 additions and 10 deletions

View File

@ -292,6 +292,7 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = {
.port = I2C_PORT_USB_C0,
.addr_flags = RAA489000_TCPC0_I2C_FLAGS,
},
.flags = TCPC_FLAGS_TCPCI_V2_0,
.drv = &raa489000_tcpm_drv,
},
@ -301,6 +302,7 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = {
.port = I2C_PORT_SUB_USB_C1,
.addr_flags = RAA489000_TCPC0_I2C_FLAGS,
},
.flags = TCPC_FLAGS_TCPCI_V2_0,
.drv = &raa489000_tcpm_drv,
},
};
@ -327,13 +329,10 @@ uint16_t tcpc_get_alert_status(void)
* alert status.
*/
if (!gpio_get_level(GPIO_USB_C0_INT_ODL)) {
/*
* TODO(b:147716486) If we decide to handle TCPCIv2.0, we cannot
* ignore bits 14:12 any longer.
*/
if (!tcpc_read16(0, TCPC_REG_ALERT, &regval)) {
/* The TCPCI v1.0 spec says to ignore bits 14:12. */
regval &= ~((1 << 14) | (1 << 13) | (1 << 12));
if (!(tcpc_config[0].flags & TCPC_FLAGS_TCPCI_V2_0))
regval &= ~((1 << 14) | (1 << 13) | (1 << 12));
if (regval)
status |= PD_STATUS_TCPC_ALERT_0;
@ -341,13 +340,10 @@ uint16_t tcpc_get_alert_status(void)
}
if (!gpio_get_level(GPIO_SUB_USB_C1_INT_ODL)) {
/*
* TODO(b:147716486) If we decide to handle TCPCIv2.0, we cannot
* ignore bits 14:12 any longer.
*/
if (!tcpc_read16(1, TCPC_REG_ALERT, &regval)) {
/* TCPCI spec v1.0 says to ignore bits 14:12. */
regval &= ~((1 << 14) | (1 << 13) | (1 << 12));
if (!(tcpc_config[1].flags & TCPC_FLAGS_TCPCI_V2_0))
regval &= ~((1 << 14) | (1 << 13) | (1 << 12));
if (regval)
status |= PD_STATUS_TCPC_ALERT_1;