Skip to content

Commit 1ace770

Browse files
jthiesatgooglegregkh
authored andcommitted
usb: typec: ucsi: Set usb mode on partner change
Currently the partner usb_mode is only set in ucsi_register_partner(). If the partner enters USB4 operation after it is registered, this is not reported to the typec class. The UCSI spec states that the Connector Partner Changed bit can represent a Connector Partner Flags change. When handling a UCSI partner change, check the partner flags for USB4 operation. Signed-off-by: Jameson Thies <jthies@google.com> Reviewed-by: Benson Leung <bleung@chromium.org> Link: https://patch.msgid.link/20260402182438.867396-1-jthies@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f58752e commit 1ace770

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/usb/typec/ucsi/ucsi.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,12 @@ static void ucsi_partner_change(struct ucsi_connector *con)
11871187
if (UCSI_CONSTAT(con, PARTNER_FLAG_USB))
11881188
typec_set_mode(con->port, TYPEC_STATE_USB);
11891189
}
1190+
1191+
if (((con->ucsi->version >= UCSI_VERSION_3_0 &&
1192+
UCSI_CONSTAT(con, PARTNER_FLAG_USB4_GEN4)) ||
1193+
(con->ucsi->version >= UCSI_VERSION_2_0 &&
1194+
UCSI_CONSTAT(con, PARTNER_FLAG_USB4_GEN3))) && con->partner)
1195+
typec_partner_set_usb_mode(con->partner, USB_MODE_USB4);
11901196
}
11911197

11921198
if ((!UCSI_CONSTAT(con, PARTNER_FLAG_USB)) &&

0 commit comments

Comments
 (0)