Skip to content

Commit 60b98b6

Browse files
committed
fix ucsi breaking on right side ports
UCSI driver was breaking on right side ports due to us responding to some messages from the left side controller instead of the right side controller This would cause the UCSI state machine to pause whenever you plugged/unplugged a device from the right side ports and no more UCSI updates would be sent to the host. Signed-off-by: Kieran Levin <ktl@frame.work>
1 parent 7b08389 commit 60b98b6

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

board/hx20/ucsi.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,25 @@ void check_ucsi_event_from_host(void)
327327
cci = &pd_chip_ucsi_info[1].cci;
328328
}
329329

330+
331+
/* Fix UCSI stopping responding to right side ports
332+
* the standard says the CCI connector change indicator field
333+
* should be 0 for ACK_CC_CI, however our controller responds with
334+
* the port number populated for the port with the valid response
335+
* so choose this response as a priority when we get an ack from
336+
* both controllers
337+
*/
338+
if (pd_chip_ucsi_info[1].read_tunnel_complete &&
339+
pd_chip_ucsi_info[0].read_tunnel_complete) {
340+
if (pd_chip_ucsi_info[0].cci & 0xFE) {
341+
message_in = pd_chip_ucsi_info[0].message_in;
342+
cci = &pd_chip_ucsi_info[0].cci;
343+
} else if (pd_chip_ucsi_info[1].cci & 0xFE) {
344+
message_in = pd_chip_ucsi_info[1].message_in;
345+
cci = &pd_chip_ucsi_info[1].cci;
346+
}
347+
}
348+
330349
if (
331350
*host_get_customer_memmap(EC_MEMMAP_UCSI_COMMAND) == UCSI_CMD_GET_CONNECTOR_STATUS &&
332351
(((uint8_t*)message_in)[8] & 0x03) > 1)

0 commit comments

Comments
 (0)