tcpc: add 2 bytes into TX byte count register

Add 2 bytes into the TX byte count register used in
TCPC interface.

BUG=chrome-os-partner:48256
BRANCH=none
TEST=load on glados and attach zinger, make sure
PD negotiation successful.

Change-Id: Ie57d79f20def861c22f6e2e023545a65825ab3b4
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/315879
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Alec Berg
2015-12-03 18:16:32 -08:00
committed by chrome-bot
parent b2945c1ce2
commit a9d7417951
2 changed files with 2 additions and 4 deletions

View File

@@ -1252,9 +1252,6 @@ static int tcpc_i2c_read(int port, int reg, uint8_t *payload)
case TCPC_REG_POWER_STATUS_MASK:
payload[0] = pd[port].power_status_mask;
return 1;
case TCPC_REG_TX_BYTE_CNT:
payload[0] = PD_HEADER_CNT(pd[port].tx_head);
return 1;
case TCPC_REG_TX_HDR:
payload[0] = pd[port].tx_head & 0xff;
payload[1] = (pd[port].tx_head >> 8) & 0xff;

View File

@@ -173,7 +173,8 @@ int tcpm_transmit(int port, enum tcpm_transmit_type type, uint16_t header,
int reg = TCPC_REG_TX_DATA;
int rv, cnt = 4*PD_HEADER_CNT(header);
rv = tcpc_write(port, TCPC_REG_TX_BYTE_CNT, cnt);
/* TX_BYTE_CNT includes 2 bytes for message header */
rv = tcpc_write(port, TCPC_REG_TX_BYTE_CNT, cnt + 2);
rv |= tcpc_write16(port, TCPC_REG_TX_HDR, header);