usb: typec: ucsi: Leave the mux to the altmode driver for alt mode partners
Subsystems (4)
PATCH 1/1 usb: typec: ucsi: Leave the mux to the altmode driver for alt mode partners
Commit 25a2bc21c863 ("usb: typec: ucsi: call typec_set_mode on non-altmode partner change") set TYPEC_STATE_USB only when the partner flags were exactly USB, so that the altmode drivers set up the switches, muxes and retimers for alt mode partners. Commit 226ff2e681d0 ("usb: typec: ucsi: Convert connector specific commands to bitmaps") turned that into a test of the USB bit alone, so a partner that reports both USB and alt mode now gets TYPEC_STATE_USB as well.
On pmic_glink platforms the altmode driver programs the same mux chain, and the two notifications are not ordered. When the UCSI connector change comes last, an FSA4480 switches the SBU lines off, the DisplayPort AUX channel stops working and the sink is never detected. On the Lenovo Y700 Gen 5 (TB323FU, Kaanapali) this happens when a DisplayPort sink is plugged in during system suspend.
Set TYPEC_STATE_USB only when the partner does not report alt mode. USB4 partners keep TYPEC_STATE_USB, as they do now.
--- drivers/usb/typec/ucsi/ucsi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/typec/ucsi/ucsi.c +2 -1
@@ -1356,7 +1356,8 @@ static void ucsi_partner_change(struct ucsi_connector *con)typec_set_mode (con->port,TYPEC_MODE_AUDIO );break ;default : -if (UCSI_CONSTAT (con,PARTNER_FLAG_USB )) +if (UCSI_CONSTAT (con,PARTNER_FLAG_USB ) && + !UCSI_CONSTAT (con,PARTNER_FLAG_ALT_MODE ))typec_set_mode (con->port,TYPEC_STATE_USB ); }
base-commit: 7649ba73f9e7e1e04d0b46213e39c79ae09dd55c
Signature · 1 line
2.43.0
[email protected]
AI reviewSashiko has reviewed this patch and found no issues.
Quoted 15 lines
Commit
25a2bc21c863("usb: typec: ucsi: calltypec_set_modeon non-altmode partner change") setTYPEC_STATE_USBonly when the partner flags were exactly USB, so that the altmode drivers set up the switches, muxes and retimers for alt mode partners. Commit226ff2e681d0("usb: typec: ucsi: Convert connector specific commands to bitmaps") turned that into a test of the USB bit alone, so a partner that reports both USB and alt mode now getsTYPEC_STATE_USBas well.On
pmic_glinkplatforms the altmode driver programs the same mux chain, and the two notifications are not ordered. When the UCSI connector change comes last, an FSA4480 switches the SBU lines off, the DisplayPort AUX channel stops working and the sink is never detected. On the Lenovo Y700 Gen 5 (TB323FU, Kaanapali) this happens when a DisplayPort sink is plugged in during system suspend.
Quoted 6 lines
Set
TYPEC_STATE_USBonly when the partner does not report alt mode. USB4 partners keepTYPEC_STATE_USB, as they do now.Fixes 226ff2e681d0 ("usb: typec: ucsi: Convert connector specific commands to bitmaps")Signed-off-by Joonhoe Kim <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Quoted 15 lines · Joonhoe Kim
Commit
25a2bc21c863("usb: typec: ucsi: calltypec_set_modeon non-altmode partner change") setTYPEC_STATE_USBonly when the partner flags were exactly USB, so that the altmode drivers set up the switches, muxes and retimers for alt mode partners. Commit226ff2e681d0("usb: typec: ucsi: Convert connector specific commands to bitmaps") turned that into a test of the USB bit alone, so a partner that reports both USB and alt mode now getsTYPEC_STATE_USBas well.On
pmic_glinkplatforms the altmode driver programs the same mux chain, and the two notifications are not ordered. When the UCSI connector change comes last, an FSA4480 switches the SBU lines off, the DisplayPort AUX channel stops working and the sink is never detected. On the Lenovo Y700 Gen 5 (TB323FU, Kaanapali) this happens when a DisplayPort sink is plugged in during system suspend.
Quoted 6 lines
Set
TYPEC_STATE_USBonly when the partner does not report alt mode. USB4 partners keepTYPEC_STATE_USB, as they do now.Fixes 226ff2e681d0 ("usb: typec: ucsi: Convert connector specific commands to bitmaps")Signed-off-by Joonhoe Kim <[email protected]>
Quoted 22 lines
--- drivers/usb/typec/ucsi/ucsi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/usb/typec/ucsi/ucsi.c +2
-1@@ -1356,7 +1356,8 @@ static void ucsi_partner_change(struct ucsi_connector *con)typec_set_mode (con->port,TYPEC_MODE_AUDIO );break ;default : -if (UCSI_CONSTAT (con,PARTNER_FLAG_USB )) +if (UCSI_CONSTAT (con,PARTNER_FLAG_USB ) && + !UCSI_CONSTAT (con,PARTNER_FLAG_ALT_MODE ))typec_set_mode (con->port,TYPEC_STATE_USB ); }base-commit:
7649ba73f9e7e1e04d0b46213e39c79ae09dd55cSignature · 1 line
2.43.0
Signature · 1 line
heikki